Activating key presses on root window

This forum is read only. No new submissions are accepted.

Questions about motif? Contact us

3 posts / 0 new
Last post
Activating key presses on root window

Submitted by Anonymous on Fri, 01/11/2002 - 18:48. Developers
I have an application consisting of motif dialogs created on IRIX, compiled for a powerPC, and running in a VxWorks environment. I would like to have function keys triggered if cursor is in root window as well as other windows (windows do not always cover entire display). I have used XtAddEventHandler(widgetId, KeyReleaseMask,FALSE,handler,NULL) to trigger the events on the dialogs, but how do I pass in the root window? Do I just XtParent the widgetId until it reaches a level past the dialog id? Thanks for any help.

ICS_support

The first problem, as you`ve noticed, is that the window hierarchy, which is rooted at RootWindow, doesn`t match your application`s widget hierarchy, which is rooted in the shell widget. Its parent, if any, is conceptually the window manager.

So the first hurdle is to wrap the root window in a way that Xt can handle.

You may be able to use XtRegisterDrawable ( http//www.motifzone.com/resources/man/XtRegisterDrawable.html ), which is new to X11R6 to help with this situation. See also the article at
http//www.motifzone.com/tmd/articles/EventWidget/events.html , which can also help you out.

But the second problem is that key events on the root window are likely to be grabbed by the window manager. You`d need to cooperate with the window manager; this means that your application can`t operate in an arbitrary environment.

Anonymous

Thank you for the information. I neglected to mention that we are running MWM in the VxWorks environment. We tried XtRegisterDrawable without success
so we have decided to try a different work around - always giving a certain window focus.