+ //---------------------------------------------------------------------------
+void wxVTKRenderWindowInteractor::OnChar(wxKeyEvent &event)
+{
+ if (!Enabled)
+ {
+ return;
+ }
+
+#if VTK_MAJOR_VERSION > 4 || (VTK_MAJOR_VERSION == 4 && VTK_MINOR_VERSION > 0)
+ // new style
+ int keycode = event.GetKeyCode();
+ char key = '\0';
+ if (((unsigned int)keycode) < 256)
+ {
+ // TODO: Unicode in non-Unicode mode ??
+ key = (char)keycode;
+ }
+
+ // we don't get a valid mouse position inside the key event on every platform
+ // so we retrieve the mouse position explicitly and pass it along
+ wxPoint mousePos = ScreenToClient(wxGetMousePosition());
+ SetEventInformationFlipY(mousePos.x, mousePos.y,
+ event.ControlDown(), event.ShiftDown(), key, 0, NULL);
+ InvokeEvent(vtkCommand::CharEvent, NULL);
+#endif
+ event.Skip();
+}