paul@cacilj.UUCP (Paul Close) (12/02/89)
I am currently having no success trying to rad characters from the keyboard. I am using DECwindows, and the Xt toolkit. Here's how I set up the keyboard read: EventMask event_mask = KeyPressMask; XtAddEventHandler(w->graphics_widget, event_mask, FALSE, key_pressed, w); where key_pressed is the routine to handle the key events and w->graphics_widget is a widget obtained by calling DwtWindow. Here is the widget hierarchy I use: w->shell_widget = XtCreateApplicationShell(title, topLevelShellWidgetClass, NULL, 0); w->main_widget = DwtMainWindow(w->shell_widget, "MainWindow", 0, 0, 0, 0); w->graphics_widget = DwtWindow(w->main_widget, "GraphicsWindow", 0, 0, width, height, w->callback); I have implemented a "mouse button pressed" routine that is almost identical, and it works just fine. With keyboard events, however, the 'key_pressed' handle never even gets called! Do I need to do more than just XtAddEventHandler? Thanks, -- Paul Close paul@cacilj.CTS.COM ...!{uunet, ucsd, crash}!cacilj!paul The Obi-wan Kenobi method: "Use the Source, Luke" -Jim Fulton
doug@ntvax.uucp (Douglas Scott) (12/07/89)
In article <1324@cacilj.UUCP> paul@cacilj.UUCP (Paul Close) writes: >I am currently having no success trying to rad characters from the keyboard. >I am using DECwindows, and the Xt toolkit. Here's how I set up the keyboard >read: > ----SOME CODE DELETED ---- >I have implemented a "mouse button pressed" routine that is almost identical, >and it works just fine. With keyboard events, however, the 'key_pressed' >handle never even gets called! Do I need to do more than just >XtAddEventHandler? I think this is a problem with the DECwindows Window Manager...cf. the posting about xdbx on the DEC 3100 and my followup. There seems to be some problem getting keyboard focus to shift to new applications. Since you don't have focus, of course you won't get any KeyPress or other Key events. Anybody out there know the solution...or the problem, even? _______________________________________ Douglas Scott doug@dept.csci.unt.edu