I need to be able to check in a random point of code if the
control key is down. However I can't find any code that
will let me do that test.
I have looked for global functions and functions part of
wxWindow/wxApp. There are functions on wxKeyEvents and
MouseEvents, but not on others such as CommandEvent.
I didn't find anything in the wiki either.
In a previous message Robin did mention that there was
talk about it being added to wxWidgets 2.5. I don't see
it there either.
The problem I am trying to solve is that my app allows you
add image files via a menu, the mouse, keystrokes and drag&drop.
It currently "intelligently" decides whether it should resize
the image. This doesn't please everyone so I wanted to add
an easy way of preventing resizing on a particular add, such
as keeping the control key down when adding the images.
By the time the actual function to add the image(s) is called,
the original event is long since gone, and most of the events
don't tell you the control state in the first place anyway.
I need to be able to check in a random point of code if the
control key is down. However I can't find any code that
will let me do that test.
I have looked for global functions and functions part of wxWindow/wxApp. There are functions on wxKeyEvents and
MouseEvents, but not on others such as CommandEvent.
I didn't find anything in the wiki either.
In a previous message Robin did mention that there was
talk about it being added to wxWidgets 2.5. I don't see
it there either.
It's called wx.GetKeyState but it hasn't been implemented yet for wxGTK and I think that the wxMSW implementation is broken. I tried working on it a couple months ago but got lost and havn't had time to go back to it.
···
--
Robin Dunn
Software Craftsman http://wxPython.org Java give you jitters? Relax with wxPython!
It's called wx.GetKeyState but it hasn't been implemented yet for wxGTK
and I think that the wxMSW implementation is broken.
Is there any gross hack I can do like hook into the event loop
and remember the values for any key or mouse events that fly by?
It's possible to hook the WndProc's on Windows (I think there is a page in the wiki about it) but I don't know of a way to do that on the other platforms.
BTW, I've just taken another look at wxGetkeyState and have fixed the MSW verison and implemented the GTK/X11 version (although it only works for the modifier and toggle keys.) I still need to test the wxMac version.
···
--
Robin Dunn
Software Craftsman http://wxPython.org Java give you jitters? Relax with wxPython!