Implemented support for changing textures depending on input + bugfix: input sometimes register several time when changing state