This source code has been tested under OpenWindows 2.0, Sun s X11/NeWS server. For Xlib programs that use KeyPress events you should either (1) set the FocusLenience resource to `True , or (2) specifically notify the window manager that you want to receive KeyPress/KeyRelease events (but only in programs that need these events).