Fixed how key pressed are handled