Implemented the keyboard section of the event loop.

Corresponds to the recent changes to goml.