Fixed bugs

Fixed some bugs with arrow keys and added a right click state for mouse.