The window manager controls how the input focus is transferred from one
window to another. In order to get keystrokes, your program must ask the
window manager for the input focus. To do this, you must set up what are
called "hints" for the window manager. If your applications is Xlib-based, you
can use something like the following:
XWMHints wmhints;
...
wmhints.flags = InputHint;
wmhints.input = True;
XSetWMHints(dpy, window, &wmhints)
If your application is based on the Xt Intrinsics, you can set the XtNinput
resource to be True (as you probably want to in any case); if you don't have
source, you can start up the application with the resource '*input:True'.
Certain window managers, notably dxwm and olwm, are very picky about having
this done.
If you are using Sun's OpenWindows olwm, you can also add this resource
to your defaults file to use clients that aren't ICCCM-compliant.
OpenWindows.FocusLenience: true
[mostly courtesy Dave Lemke of NCD and Stuart Marks of Sun]

User Contributions:

Comment about this article, ask questions, or add new information about this topic: