Wrote InputState, a helper class for input handling.