Moved inputstates to its own class that handles processing events.