changed how key events are handled