[vtkusers] OnKeyRelease...[SOLVED...i think]

Andrew Dolgert ajd27 at cornell.edu
Thu Jun 3 11:27:06 EDT 2004


 Hi Ingo -

>From what I recall of the code, I think overriding OnKeyPress() is
preferable to OnKeyDown().
1. User hits key
2. GUI sends OS key event to interactor
3. interactor calls OnKeyDown() method
4. OnKeyDown() method creates an event, carrying state of shift and control
keys and the key value
5. OnKeyDown() sends that event to all listeners
6. One of those many listeners is the interactor itself, so OnKeyPress()
receives that event

I would guess you don't want to mess with whether the vtkKeyPress event does
or doesn't get sent to all interested parties, so it's better just to
override OnKeyPress.

Greets to you, too,
Drew




More information about the vtkusers mailing list