Re: [wxVTK] RE: wxVTK [Panther Carbon, wx 2.6.2 ] Key event within wxSashLayoutWindow
Brought to you by:
malat
From: Mathieu M. <mma...@ny...> - 2005-10-18 02:26:10
|
Nigel, Thanks for taking the time to test it. Unfortunately the problem I am reporting is happening even before I get the hand on the event. The function OnChar, OnKeyUp and OnKeyDown never gets call. The trouble is I don't really know where to start looking. Advices ? Mathieu Nigel Nunn wrote: > Hi Mathieu, > > On Sun, 16 Oct 2005 <mat...@ki...> wrote > > >>Unfortunately I cannot get the EVT_CHAR/ EVT_KEYDOWN >>to work in this case. Any suggestion on how to debug >>and understand what is going on ? > > > > I noticed a few probs after updating to a recent CVS Vtk. While > debugging I added a few lines to v1.21 of your wxVtkRWI.cxx. > (My wx is __WXMSW__ using VC++ 7.1): > > Module: $RCSfile: wxVTKRenderWindowInteractor.cxx,v $ > Language: C++ > Date: $Date: 2005/10/16 21:40:31 $ > Version: $Revision: 1.21 $ > > > I appended the following to both OnKeyDown, OnKeyUp: > > > // ... > // ... > // ... > > wxWindow* pW = GetParent(); > if (pW) { > pW->ProcessEvent(event); > } > } > > > Below are my versions. May help with your issue. > thanks, > Nigel > > > //--------------------------------------------------------- > void wxVtkRWI::OnKeyDown(wxKeyEvent &event) > //--------------------------------------------------------- > { > if (!Enabled) { > return; > } > > #if VTK_MAJOR_VERSION == 5 || (VTK_MAJOR_VERSION == 4 && VTK_MINOR_VERSION > 0) > // new style > int keycode = event.GetKeyCode(); > char key = '\0'; > if (keycode < 256) { > // TODO: Unicode in non-Unicode mode ?? > key = (char)keycode; > } > > SetEventInformationFlipY(event.GetX(), event.GetY(), event.ControlDown(), > event.ShiftDown(), key, 0, NULL); > InvokeEvent(vtkCommand::KeyPressEvent, NULL); > InvokeEvent(vtkCommand::CharEvent, NULL); > #else > InteractorStyle->OnKeyDown(event.ControlDown(), event.ShiftDown(), > event.GetKeyCode(), 1); > #endif > > event.Skip(); > > // NBN: > wxWindow* pW= GetParent(); > if (pW) { > pW->ProcessEvent(event); > } > } > > > //--------------------------------------------------------- > void wxVtkRWI::OnKeyUp(wxKeyEvent &event) > //--------------------------------------------------------- > { > if (!Enabled) { > return; > } > > #if VTK_MAJOR_VERSION == 5 || (VTK_MAJOR_VERSION == 4 && VTK_MINOR_VERSION > 0) > // new style > int keycode = event.GetKeyCode(); > char key = '\0'; > if (keycode < 256) { > // TODO: Unicode in non-Unicode mode ?? > key = (char)keycode; > } > > SetEventInformationFlipY(event.GetX(), event.GetY(), event.ControlDown(), > event.ShiftDown(), key, 0, NULL); > InvokeEvent(vtkCommand::KeyReleaseEvent, NULL); > #else > InteractorStyle->OnKeyUp(event.ControlDown(), event.ShiftDown(), > event.GetKeyCode(), 1); > #endif > > event.Skip(); > > // NBN: > wxWindow* pW = GetParent(); > if (pW) { > pW->ProcessEvent(event); > } > } > > --- > NN. > > > > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------------------- > This message is intended for the addressee named and may contain confidential and priveleged information. If you are not the intended recipient please note that any form of distribution, copying or use of this communication or the information in it is strictly prohibited and may be unlawful. If you receive this message in error, please delete it and notify the sender. > > Keep up to date with what's happening in Australian sport. > Visit http://www.ausport.gov.au > ------------------------------------------------------------------------------------- |