wxCommandEvent Modifiers

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
MikeLift
In need of some credit
In need of some credit
Posts: 4
Joined: Thu May 06, 2021 6:52 pm

wxCommandEvent Modifiers

Post by MikeLift »

In the article "wxButton simulate click" doublemax writes:
The wxCommandEvent normally contains lots of information, e.g. a pointer to the object that was clicked, its ID, mouse coordinates, status of keyboard modifiers, etc.
Where are the keyboard modifiers? How do i get this information from wxCommandvent? :(
I would like to read modifiers when clicking a wxButton, binding with wxEVT_BUTTON.
User avatar
doublemax
Moderator
Moderator
Posts: 19103
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: wxCommandEvent Modifiers

Post by doublemax »

I don't know if that was correct when i wrote it, but it's wrong today. Only wxMouseEvent contains keyboard modifiers.

But you can check them at any time using wxGetKeyState()
https://docs.wxwidgets.org/trunk/group_ ... 41b71ce84f
Use the source, Luke!
Post Reply