[comp.windows.x] Not getting desired keystrokes

mouse@lightning.mcrcim.mcgill.EDU (02/08/91)

> I had been programed using X-lib in 'mwm'.
> Resently, I have a new enviroment openlook in SUN-SPARK-station-2

> first. some programs using only x-lib (not X/view) does not execute
> in Openlook.  when key-event alise ( I press a keyboard ), this
> enviroment does not supply key event ( KeyPress ) to process.  only
> beep sounds occured.

From the Frequently Asked Questions posting:

----------------------------------------------------------------------
Subject: 74)  Why doesn't my program get the keystrokes I select for?

	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, &hints)


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]
----------------------------------------------------------------------

					der Mouse

			old: mcgill-vision!mouse
			new: mouse@larry.mcrcim.mcgill.edu