move keyboard events into classes