added horizontal movement for mouse and keyboard