Change the way events are posted to the GUI server.

This change fixes a few keyboard related bugs with event handling.