View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0006004VTK(No Category)public2007-11-04 13:252016-08-12 09:54
ReporterChris Kruszynski 
Assigned ToKarthik Krishnan 
PrioritynormalSeveritymajorReproducibilityalways
StatusclosedResolutionmoved 
PlatformXWindowsOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0006004: Keyboard event handling in new style widgets is horribly broken.
DescriptionThere 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.
Steps To Reproduce- Put a vtkContourWidget in a window and enable it.
- Click around a bit creating a number of points for the contour.
- Press the shift key.
- Notice how part of the contour is deleted, even though the widget should only delete contour points when the '/' key (code 47) is pressed.

The second issue can probably be reproduced by first adding an event translation for some key with AnyModifier, and then one with NoModifier, pressing the key, and noticing that the translation with AnyModifier is used instead of the one with NoModifier.
TagsNo tags attached.
Project
Type
Attached Files

 Relationships

  Notes
(0010639)
Karthik Krishnan (reporter)
2008-02-24 12:56

This is fixed. See the mails on the developers list and the mails:

http://public.kitware.com/pipermail/vtk-developers/2007-December/004865.html [^]
http://public.kitware.com/pipermail/vtk-developers/2007-December/004876.html [^]
http://public.kitware.com/pipermail/vtk-developers/2007-December/004858.html [^]
http://public.kitware.com/pipermail/vtk-developers/2007-December/004861.html [^]
(0010647)
Chris Kruszynski (reporter)
2008-02-26 08:30

The issue with vtkAbstractWidget::ProcessEventsHandler() is still present. I propose the following patch:

--- vtkAbstractWidget.cxx 9 Jan 2008 15:30:29 -0000 1.15
+++ vtkAbstractWidget.cxx 26 Feb 2008 13:29:12 -0000
@@ -215,7 +215,7 @@
 
   // If neither the ctrl nor the shift keys are pressed, give
   // NoModifier a preference over AnyModifer.
- if (modifier == vtkEvent::AnyModifier)
+ if (modifier == vtkEvent::NoModifier)
     {
     widgetEvent = self->EventTranslator->GetTranslation(vtkEvent,
                                           vtkEvent::NoModifier,
(0036936)
Kitware Robot (administrator)
2016-08-12 09:54

Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current VTK Issues page linked in the banner at the top of this page.

 Issue History
Date Modified Username Field Change
2007-11-04 13:25 Chris Kruszynski New Issue
2008-02-06 09:38 Jeff Baumes Status backlog => tabled
2008-02-06 09:38 Jeff Baumes Assigned To => Karthik Krishnan
2008-02-24 12:56 Karthik Krishnan Status tabled => @80@
2008-02-24 12:56 Karthik Krishnan Resolution open => fixed
2008-02-24 12:56 Karthik Krishnan Note Added: 0010639
2008-02-26 08:30 Chris Kruszynski Status @80@ => @20@
2008-02-26 08:30 Chris Kruszynski Resolution fixed => reopened
2008-02-26 08:30 Chris Kruszynski Note Added: 0010647
2011-06-16 13:11 Zack Galbreath Category => (No Category)
2016-08-12 09:54 Kitware Robot Note Added: 0036936
2016-08-12 09:54 Kitware Robot Status expired => closed
2016-08-12 09:54 Kitware Robot Resolution reopened => moved


Copyright © 2000 - 2018 MantisBT Team