Keyboard event handling in new style widgets is horribly broken.
This issue was created automatically from an original Mantis Issue. Further discussion may take place here.
There is a major issue with the handling of keyboard events in the new style widgets. Apparently it is assumed that providing a KeySym string to the callback mapper which is set to NULL will cause the event translator to only compare the provided key code to the key code of an event, and ignore the KeySym string/character.
This assumption fails when various control keys (such as ctrl or shift) are pressed: these keys return a keycode value of 0. The vtkEvent::operator==() method will not compare keycodes if either of the events has a keycode 0 (the keypress has this keycode), it will not compare keysyms if either is NULL (the widget set it to NULL), and as a result the comparison will return 1, and the widget will receive a keypress event, even though the key which was pressed was not the one that the widget wanted.
Another issue with the key handling is in vtkAbstractWidget::ProcessEventsHandler(). The comparison (modifier == vtkEvent::AnyModifier) will always be false, because the previously called vtkEvent::GetModifier() never returns the value vtkEvent::AnyModifier. The part where first event translations which want vtkEvent::NoModifier are checked, and then the ones that want vtkEvent::AnyModifier never gets executed.