MantisBT - VTK
View Issue Details
0015777VTK(No Category)public2015-10-13 13:312016-08-12 09:55
normanius 
Kitware Robot 
normalminorhave not tried
closedmoved 
6.2.0 
 
Release
incorrect functionality
0015777: Arrow-key press-events are not seen by vtkRenderWindowInteractor on Windows
Why are arrow key-press events not forwarded to the vtkRenderWindowInteractor on Windows? Is there a workaround? Is there a general difference between arrow-key events on Windows and Mac?

I can reproduce the problem with the sample code attached. On Mac OS, I see 'Up', 'Down', 'Left' and 'Right' if I press the arrow keys. But on Windows, I don't see anything (the callback is not entered). I wondered why this is the case.

I use VTK 6.2.0 for python 2.7. I tested on Windows Server 2012 (similar to Windows 8) and Windows 7 (on a virtual machine), showing both the same behaviour.
hackaton, Interaction, python
? test_keypress_events.py (1,711) 2015-10-13 13:31
https://www.vtk.org/Bug/file/9926/test_keypress_events.py
? test_keypress_events_win_tested.py (1,496) 2015-10-21 15:05
https://www.vtk.org/Bug/file/9940/test_keypress_events_win_tested.py
Issue History
2015-10-13 13:31normaniusNew Issue
2015-10-13 13:31normaniusFile Added: test_keypress_events.py
2015-10-13 13:35normaniusTag Attached: Interaction
2015-10-13 13:35normaniusTag Attached: python
2015-10-19 14:54Utkarsh AyachitTag Attached: hackaton
2015-10-21 15:03Hyun Jae KangNote Added: 0035360
2015-10-21 15:05Hyun Jae KangFile Added: test_keypress_events_win_tested.py
2015-10-21 15:06Hyun Jae KangNote Edited: 0035360bug_revision_view_page.php?bugnote_id=35360#r1361
2015-11-13 13:10normaniusNote Added: 0035450
2016-08-12 09:55Kitware RobotNote Added: 0037425
2016-08-12 09:55Kitware RobotStatusbacklog => closed
2016-08-12 09:55Kitware RobotResolutionopen => moved
2016-08-12 09:55Kitware RobotAssigned To => Kitware Robot

Notes
(0035360)
Hyun Jae Kang   
2015-10-21 15:03   
(edited on: 2015-10-21 15:06)
Please use the keyword of "KeyPressEvent" instead of "CharEvent" in the function of AddObserver as following:

- self.AddObserver("CharEvent",self.onKeyPressEvent)
+ self.AddObserver("KeyPressEvent",self.onKeyPressEvent)

I tested the script file on Windows 7 and vtk 6.3.

Please check the attached file of "test_keypress_events_win_tested.py"

(0035450)
normanius   
2015-11-13 13:10   
Indeed - this fixed my issue. Many thanks!
(0037425)
Kitware Robot   
2016-08-12 09:55   
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.