Cleaned up X11 keyboard handling a bit