[vtk-developers] vtkCarbonRenderWindowInteractor keyboard input is broken

David Gobbi david.gobbi at gmail.com
Fri Dec 11 14:45:06 EST 2009

Okay, I've committed the keyboard fixes for
vtkCarbonRenderWindowInteractor.  This included:

1) Fixing some ugly code that created unterminated strings and whatnot.

2) Adding a keycode -> keysym translation table so that it generates
the same keysyms as the Win32 and X interactors.

3) Including kEventRawKeyModifiersChanged to the event list and adding
code to generate KeyPress/KeyRelease events for modifier keys.  The
modifier handling for these events has been made compatible with Win32
and X.

So, in short, this interactor will finally return valid keysyms, and
this is something it never did before.


On Fri, Dec 11, 2009 at 6:39 AM, David Gobbi <david.gobbi at gmail.com> wrote:
> Hi All,
> It looks like the keyboard input for the
> vtkCarbonRenderWindowInteractor is badly broken.  I tried capturing
> key events and this is what was returned.  The keysym strings are
> unterminated, and modifier keys like "Control" etc. don't produce
> keysyms at all.
>  print repr(iren.GetKeySym()) -> expected 'k'
>  'k????byek'
>  print repr(iren.GetKeySym()) -> expected 'Control_L'
>  ''
> Furthermore, the GetShiftKey(), GetControlKey(), and GetAltKey()
> methods return raw bit patterns instead of boolean values:
>  print iren.GetShiftKey() -> 512
>  print iren.GetControlKey() -> 4096
> I'm working through the code right now and will post back after I've
> committed the fix, but I just thought that I should warn people who
> are using this class for keyboard interaction.  Hopefully the Cocoa
> version is in better shape.
>   David

More information about the vtk-developers mailing list