Alt key release doesn't always trigger: python 3.7, vtk8.2 and pyqt5

Hi all,

I am developing an application in Python 3.7 with PyQt5 and vtk 8.2.0 on Windows 7 / 10. I have a custom interactor class derived from vtkInteractorStyleTrackballCamera. I have added observers for KeyPressEvent and KeyReleaseEvent into this class.

One of the keys I use is the ALT key. When the ALT key is pressed it always registers the KeyPressEvent. However, it doesn’t always register the KeyReleaseEvent, which causes some issues. I have tested on multiple PCs, so it is not my dodgy keyboard!

Could there be something in the vtk source code that is causing this?


If you press and release Alt key on Windows then the focus may be taken away from the VTK interactor (and given to the window menu) so the interactor may not be notified about the release of the key. You might be able to confirm this or find out more if you add breakpoints in QVTKInteractor.