Key press events on a window 
Author Message
 Key press events on a window

I need to trap some key press events on a normal VisualAge window
(AbtShellView).
Adding a key press event handler on  CwTopLevelShell or CwMainWindow do not
work. On CwText it works but then I have to have the focus on the text
field.

Do You have any suggestions?

Yours,
    Pertti Suhonen
    Delectia Oy
    Tampere, Finland



Wed, 18 Jun 1902 08:00:00 GMT  
 Key press events on a window



Quote:
> Adding a key press event handler on  CwTopLevelShell or CwMainWindow do
not
> work. On CwText it works but then I have to have the focus on the text
> field.

Bit of a problem, isn't it? The only solution I came up with is enumerating
the widget tree and adding a keyboard event handler to every leaf of that
tree (you can don that easily using a "depth first" recursion). Just make
sure that one of the child widgets receives focus once your CwTopLevelShell
reveives focus (remember the user cannot cause the "no child has focus"
situation by GUI interaction).

Hope this helps

Andreas



Wed, 18 Jun 1902 08:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. IBM VA close window upon key pressed event

2. Trapping a key press event

3. How to capture key-presses (keyboard-presses)???

4. Make windows believe that a key was pressed or released

5. binding problem: destroying toplevel windows by pressing a key

6. key event handling on ACL Windows 3.0.2

7. Only One Tkinter Entry can receive key event event in Linux RH8.0

8. Tracking key presses, mouse clicks and mouse movements?

9. many keys pressed at the same time

10. Command-key presses

11. Changing the cursor when control key pressed.

12. Selecting TAB sheet by pressing TAB key

 

 
Powered by phpBB® Forum Software