[comp.windows.x.motif] adding an event handler for keypresses

frank@cis.ohio-state.edu (Frank Adelstein) (04/29/91)

Hello.  I'm having problems trying to add an event handler for KeyPress
events.  Basically, for debugging, I want to be able to quit my application
whenever I hit a 'q' key.  I have the line:

XtAddEventHandler (Frame, KeyPressMask, False, KeyQuit, NULL);

where Frame is a form widget, and KeyQuit is the callback, which is never
getting called (back).  I've been able to get the same thing to work under
Athena.  Is there something obvious or subtle that I'm missing?  Any
suggestion or help is appreciated.  Thanks.

--Frank Adelstein.
  frank@cis.ohio-state.edu

slh@gibdo.engr.washington.edu (05/04/91)

In article <114159@tut.cis.ohio-state.edu> frank@cis.ohio-state.edu (Frank Adelstein) writes:
|Hello.  I'm having problems trying to add an event handler for KeyPress
|events.  Basically, for debugging, I want to be able to quit my application
|whenever I hit a 'q' key.  I have the line:
|
|XtAddEventHandler (Frame, KeyPressMask, False, KeyQuit, NULL);
|
|where Frame is a form widget, and KeyQuit is the callback, which is never
|getting called (back).  I've been able to get the same thing to work under
|Athena.  Is there something obvious or subtle that I'm missing?  Any
|suggestion or help is appreciated.  Thanks.
|
	The problem probably isn't your event handler, but keyboard focus,
	the widget is never getting the keypress.