Thread: [wxVTK] Fwd: [ wxvtk-Bugs-1919659 ] keyboard events not caught
Brought to you by:
malat
From: Mathieu M. <mat...@gm...> - 2008-04-08 21:11:11
|
Hi there, Is anyone using wx 2.8.7 ? Could anyone confirm the bug ? Thanks -Mathieu ---------- Forwarded message ---------- From: SourceForge.net <no...@so...> Date: Wed, Mar 19, 2008 at 4:30 PM Subject: [ wxvtk-Bugs-1919659 ] keyboard events not caught To: no...@so... Bugs item #1919659, was opened at 2008-03-19 14:30 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=669338&aid=1919659&group_id=114757 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Interface Group: v1.0 (example) Status: Open Resolution: None Priority: 5 Private: No Submitted By: JulleJuntunen (jullejuntunen) Assigned to: Mathieu Malaterre (malat) Summary: keyboard events not caught Initial Comment: Hi, Keyboard events are not caught on Gentoo Linux (2.6.22-gentoo-r5) using wxWidgets GTK 2.8.7. This means VTK keyboard interactions won't work in a wxVTK window. This behaviour can be seen simply by adding a printout as the first line in wxVTKRenderWindowInteractor::OnKeyDown() method and then running any of the included test applications -> on any keypress the OnKeyDown() is not invoked (no printout). Problem seems to be due to not passing keyboard focus to wxVTK (wxGLCanvas) window. One simple fix that works for me is to add line SetFocus() into method wxVTKRenderWindowInteractor::OnEnter(), i.e. when ever the VTK window is entered the keyboard focus is forced to this window. Not sure if this works as a general fix, but I guess similar thing should be done at least when clicking the window. My wxVTK versions are 1.30 for wxVTKRenderWindowInteractor.cxx 1.16 for wxVTKRenderWindowInteractor.h I've checked this also on windows, with exactly the same results. cheers -julle ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=669338&aid=1919659&group_id=114757 -- Mathieu |
From: Mathieu M. <mat...@gm...> - 2008-04-14 15:08:56
|
Hello, On Mon, Apr 14, 2008 at 4:25 PM, Juha-Ville Juntunen <jul...@gm...> wrote: > Hi Mathieu, > > Tried HEAD version on Gentoo with wxSample and the problem is still there. > > Btw. I noticed > > this->SetFocus() > > added into OnButtonDown(event) method, but it's #ifdefine'd only for Mac OSX > and Windows. If I take those #ifdefines out, behaviour changes a bit:I still > don't get keyboard events caught by wxVTK when I enter the wxSample window, > but after I click the window keyevents are caught. Is there reason > SetFocus() is not meant to be invoked on linux ? Simply because you are the first person to have this issue :) Well it looks like the patch was not tested under linux, or at least not under your specific configuration. I am pretty sure this is again a GTK 1.X vs GTK 2.x problem. I'll add the SetFocus for everybody, and hope that someone complains back if I broke anything :) Thanks again for your time, your feedback is extremely important, as I cannot test all possible configurations. -- Mathieu |
From: Mathieu M. <mat...@gm...> - 2008-04-14 15:12:31
|
done thanks. $ cvs ci -m"BUG: Apparently SetFocus is also needed on linux. Thanks to Juha-Ville Juntunen for report/patch" wxVTKRenderWindowInteractor.cxx Checking in wxVTKRenderWindowInteractor.cxx; /cvsroot/wxvtk/wxVTK/src/wxVTKRenderWindowInteractor.cxx,v <-- wxVTKRenderWindowInteractor.cxx new revision: 1.36; previous revision: 1.35 done On Mon, Apr 14, 2008 at 4:25 PM, Juha-Ville Juntunen <jul...@gm...> wrote: > Hi Mathieu, > > Tried HEAD version on Gentoo with wxSample and the problem is still there. > > Btw. I noticed > > this->SetFocus() > > added into OnButtonDown(event) method, but it's #ifdefine'd only for Mac OSX > and Windows. If I take those #ifdefines out, behaviour changes a bit:I still > don't get keyboard events caught by wxVTK when I enter the wxSample window, > but after I click the window keyevents are caught. Is there reason > SetFocus() is not meant to be invoked on linux ? > > cheers > -j > > 2008/4/13, Mathieu Malaterre <mat...@gm...>: > > > Julle > > > > If you get a chance, could you please try the CVS HEAD version of wxVTK. > > > > Thanks > > -Mathieu > > > > On Tue, Apr 8, 2008 at 11:11 PM, Mathieu Malaterre > > <mat...@gm...> wrote: > > > Hi there, > > > > > > Is anyone using wx 2.8.7 ? Could anyone confirm the bug ? > > > > > > Thanks > > > -Mathieu > > > > > > > > > > > > > > > > > ---------- Forwarded message ---------- > > > From: SourceForge.net <no...@so...> > > > Date: Wed, Mar 19, 2008 at 4:30 PM > > > Subject: [ wxvtk-Bugs-1919659 ] keyboard events not caught > > > To: no...@so... > > > > > > > > > Bugs item #1919659, was opened at 2008-03-19 14:30 > > > Message generated for change (Tracker Item Submitted) made by Item > Submitter > > > You can respond by visiting: > > > > https://sourceforge.net/tracker/?func=detail&atid=669338&aid=1919659&group_id=114757 > > > > > > Please note that this message will contain a full copy of the comment > thread, > > > including the initial issue submission, for this request, > > > not just the latest update. > > > Category: Interface > > > Group: v1.0 (example) > > > Status: Open > > > Resolution: None > > > Priority: 5 > > > Private: No > > > Submitted By: JulleJuntunen (jullejuntunen) > > > Assigned to: Mathieu Malaterre (malat) > > > Summary: keyboard events not caught > > > > > > Initial Comment: > > > Hi, > > > > > > Keyboard events are not caught on Gentoo Linux (2.6.22-gentoo-r5) > > > using wxWidgets GTK 2.8.7. > > > This means VTK keyboard interactions won't work in a wxVTK window. > > > > > > This behaviour can be seen simply by adding a printout as the first > > > line in wxVTKRenderWindowInteractor::OnKeyDown() method and then > > > running any of the included test applications -> on any keypress the > > > OnKeyDown() is not invoked (no printout). > > > > > > Problem seems to be due to not passing keyboard focus to wxVTK > > > (wxGLCanvas) window. > > > > > > One simple fix that works for me is to add line > > > SetFocus() into method wxVTKRenderWindowInteractor::OnEnter(), i.e. > > > when ever the VTK window is entered the keyboard focus is forced to > > > this window. Not sure if this works as a general fix, but I guess > > > similar thing should be done at least when clicking the window. > > > > > > My wxVTK versions are > > > > > > 1.30 for wxVTKRenderWindowInteractor.cxx > > > 1.16 for wxVTKRenderWindowInteractor.h > > > > > > I've checked this also on windows, with exactly the same results. > > > > > > cheers > > > -julle > > > > > > ---------------------------------------------------------------------- > > > > > > You can respond by visiting: > > > > https://sourceforge.net/tracker/?func=detail&atid=669338&aid=1919659&group_id=114757 > > > > > > > > > > > > > > -- > > > Mathieu > > > > > > > > > > > -- > > > > Mathieu > > > > -- Mathieu |
From: Mathieu M. <mat...@gm...> - 2008-04-14 18:42:10
|
Please CC the wxVTK mailing list, as other might also have seen this issue. Just as a first step, did you try switching the wxGLCanvas to a regular wxWindow. You need to edit wxVTKRWI and remove the #define WX_USEGLCANVAS I have seen some flickering issue with wxGLCanvas, so... Anyone else seen this ? Thanks -Mathieu On Mon, Apr 14, 2008 at 5:58 PM, Juha-Ville Juntunen <jul...@gm...> wrote: > Thanks Mathieu, > > I'm using wxVTK on both linux and winXP and we might even port our app to OS > X at some point, so > I guess this makes me a suitable guinea pig for wxVTK testing ;) And I'm > happy to try out new versions of wxVTK in our environments when ever > available. > > Btw. I found another small weirdness in GTK version and this one does not > happen on windows: > > Apparently screen refreshing does not go right in GTK version because simply > calling wxWindows::Refresh() on the wxVTKRenderWindowInteractor leaves the > GL canvas blank. > Or it looks more like the GL content is first drawn and then the wxWidgets > container paints it over with the background color. > > This behaviour can be also seen with the wxSample app: when started the > screen is blank until user clicks the screen with mouse. Also, if user > switches between windows (e.g. alt-TAB) so that wxSample gets hidden and > then exposed/activated again the window is blank. Some times the content > (the cone) flashes in just for fraction of second before its painted over, > and this makes me believe it's overdrawn by the background colour by > wxWidgets. > > I got this problem fixed by explicitly throwing wxPaintEvent to > wxVTKrenderWindowInteractor when ever I need to refresh the VTK image. This > behgaviour can be seen in the Sample.cpp this by adding handler for > wxFocusEvent with following implementation: > > void MyFrame::OnFocus(wxFocusEvent&event) > { > wxPaintEvent e; > m_pVTKWindow->GetEventHandler()->AddPendingEvent(e); > > // if above line is commented and following uncommented > // screen refreshing does not work anymore > //m_pVTKWindow->Refresh(); > } > > I.e. with above implementation wxVTK screen gets correctly drawn when ever > mouse is moved over it. And if the Refresh() is used instead of > AddPendindgEvent() above, the wxVTK gets erased when ever mouse is moved > out and back over the wxVTK window. > > Not sure, however, if this one is bug or just a feature ? > > cheers > -j > > > > > 2008/4/14, Mathieu Malaterre <mat...@gm...>: > > > Hello, > > > > On Mon, Apr 14, 2008 at 4:25 PM, Juha-Ville Juntunen > > <jul...@gm...> wrote: > > > Hi Mathieu, > > > > > > Tried HEAD version on Gentoo with wxSample and the problem is still > there. > > > > > > Btw. I noticed > > > > > > this->SetFocus() > > > > > > added into OnButtonDown(event) method, but it's #ifdefine'd only for Mac > OSX > > > and Windows. If I take those #ifdefines out, behaviour changes a bit:I > still > > > don't get keyboard events caught by wxVTK when I enter the wxSample > window, > > > but after I click the window keyevents are caught. Is there reason > > > SetFocus() is not meant to be invoked on linux ? > > > > Simply because you are the first person to have this issue :) > > Well it looks like the patch was not tested under linux, or at least > > not under your specific configuration. I am pretty sure this is again > > a GTK 1.X vs GTK 2.x problem. I'll add the SetFocus for everybody, and > > hope that someone complains back if I broke anything :) > > > > Thanks again for your time, your feedback is extremely important, as I > > cannot test all possible configurations. > > -- > > > > Mathieu > > > > -- Mathieu |
From: Juha-Ville J. <jul...@gm...> - 2008-04-21 17:16:54
|
Hi, Tried this, I believe you meant this line in wxVTKRWI.h: #if (!wxCHECK_VERSION(2, 8, 0)) #define USE_WXGLCANVAS #endif After commenting the #define I couldn't see any difference in the behaviour, not in original case nor with my paint event -fix. cheers -j 2008/4/14, Mathieu Malaterre <mat...@gm...>: > > Please CC the wxVTK mailing list, as other might also have seen this > issue. > > Just as a first step, did you try switching the wxGLCanvas to a > regular wxWindow. You need to edit wxVTKRWI and remove the > > #define WX_USEGLCANVAS > > I have seen some flickering issue with wxGLCanvas, so... > > Anyone else seen this ? > > Thanks > -Mathieu > > On Mon, Apr 14, 2008 at 5:58 PM, Juha-Ville Juntunen > > <jul...@gm...> wrote: > > Thanks Mathieu, > > > > I'm using wxVTK on both linux and winXP and we might even port our app > to OS > > X at some point, so > > I guess this makes me a suitable guinea pig for wxVTK testing ;) And > I'm > > happy to try out new versions of wxVTK in our environments when ever > > available. > > > > Btw. I found another small weirdness in GTK version and this one does > not > > happen on windows: > > > > Apparently screen refreshing does not go right in GTK version because > simply > > calling wxWindows::Refresh() on the wxVTKRenderWindowInteractor leaves > the > > GL canvas blank. > > Or it looks more like the GL content is first drawn and then the > wxWidgets > > container paints it over with the background color. > > > > This behaviour can be also seen with the wxSample app: when started the > > screen is blank until user clicks the screen with mouse. Also, if user > > switches between windows (e.g. alt-TAB) so that wxSample gets hidden and > > then exposed/activated again the window is blank. Some times the content > > (the cone) flashes in just for fraction of second before its painted > over, > > and this makes me believe it's overdrawn by the background colour by > > wxWidgets. > > > > I got this problem fixed by explicitly throwing wxPaintEvent to > > wxVTKrenderWindowInteractor when ever I need to refresh the VTK image. > This > > behgaviour can be seen in the Sample.cpp this by adding handler for > > wxFocusEvent with following implementation: > > > > void MyFrame::OnFocus(wxFocusEvent&event) > > { > > wxPaintEvent e; > > m_pVTKWindow->GetEventHandler()->AddPendingEvent(e); > > > > // if above line is commented and following uncommented > > // screen refreshing does not work anymore > > //m_pVTKWindow->Refresh(); > > } > > > > I.e. with above implementation wxVTK screen gets correctly drawn when > ever > > mouse is moved over it. And if the Refresh() is used instead of > > AddPendindgEvent() above, the wxVTK gets erased when ever mouse is > moved > > out and back over the wxVTK window. > > > > Not sure, however, if this one is bug or just a feature ? > > > > cheers > > -j > > > > > > > > > > 2008/4/14, Mathieu Malaterre <mat...@gm...>: > > > > > Hello, > > > > > > On Mon, Apr 14, 2008 at 4:25 PM, Juha-Ville Juntunen > > > <jul...@gm...> wrote: > > > > Hi Mathieu, > > > > > > > > Tried HEAD version on Gentoo with wxSample and the problem is still > > there. > > > > > > > > Btw. I noticed > > > > > > > > this->SetFocus() > > > > > > > > added into OnButtonDown(event) method, but it's #ifdefine'd only for > Mac > > OSX > > > > and Windows. If I take those #ifdefines out, behaviour changes a > bit:I > > still > > > > don't get keyboard events caught by wxVTK when I enter the wxSample > > window, > > > > but after I click the window keyevents are caught. Is there reason > > > > SetFocus() is not meant to be invoked on linux ? > > > > > > Simply because you are the first person to have this issue :) > > > Well it looks like the patch was not tested under linux, or at least > > > not under your specific configuration. I am pretty sure this is again > > > a GTK 1.X vs GTK 2.x problem. I'll add the SetFocus for everybody, and > > > hope that someone complains back if I broke anything :) > > > > > > Thanks again for your time, your feedback is extremely important, as I > > > cannot test all possible configurations. > > > -- > > > > > > Mathieu > > > > > > > > > > > > -- > > Mathieu > |
From: Mathieu M. <mat...@gm...> - 2008-04-13 22:31:44
|
Julle If you get a chance, could you please try the CVS HEAD version of wxVTK. Thanks -Mathieu On Tue, Apr 8, 2008 at 11:11 PM, Mathieu Malaterre <mat...@gm...> wrote: > Hi there, > > Is anyone using wx 2.8.7 ? Could anyone confirm the bug ? > > Thanks > -Mathieu > > > > > ---------- Forwarded message ---------- > From: SourceForge.net <no...@so...> > Date: Wed, Mar 19, 2008 at 4:30 PM > Subject: [ wxvtk-Bugs-1919659 ] keyboard events not caught > To: no...@so... > > > Bugs item #1919659, was opened at 2008-03-19 14:30 > Message generated for change (Tracker Item Submitted) made by Item Submitter > You can respond by visiting: > https://sourceforge.net/tracker/?func=detail&atid=669338&aid=1919659&group_id=114757 > > Please note that this message will contain a full copy of the comment thread, > including the initial issue submission, for this request, > not just the latest update. > Category: Interface > Group: v1.0 (example) > Status: Open > Resolution: None > Priority: 5 > Private: No > Submitted By: JulleJuntunen (jullejuntunen) > Assigned to: Mathieu Malaterre (malat) > Summary: keyboard events not caught > > Initial Comment: > Hi, > > Keyboard events are not caught on Gentoo Linux (2.6.22-gentoo-r5) > using wxWidgets GTK 2.8.7. > This means VTK keyboard interactions won't work in a wxVTK window. > > This behaviour can be seen simply by adding a printout as the first > line in wxVTKRenderWindowInteractor::OnKeyDown() method and then > running any of the included test applications -> on any keypress the > OnKeyDown() is not invoked (no printout). > > Problem seems to be due to not passing keyboard focus to wxVTK > (wxGLCanvas) window. > > One simple fix that works for me is to add line > SetFocus() into method wxVTKRenderWindowInteractor::OnEnter(), i.e. > when ever the VTK window is entered the keyboard focus is forced to > this window. Not sure if this works as a general fix, but I guess > similar thing should be done at least when clicking the window. > > My wxVTK versions are > > 1.30 for wxVTKRenderWindowInteractor.cxx > 1.16 for wxVTKRenderWindowInteractor.h > > I've checked this also on windows, with exactly the same results. > > cheers > -julle > > ---------------------------------------------------------------------- > > You can respond by visiting: > https://sourceforge.net/tracker/?func=detail&atid=669338&aid=1919659&group_id=114757 > > > > -- > Mathieu > -- Mathieu |