[ wxwindows-Patches-1521490 ] Make wxGetKeyState() work for non-meta keys too

SourceForge.net noreply at sourceforge.net
Wed Jul 12 15:04:04 PDT 2006


Patches item #1521490, was opened at 2006-07-12 22:04
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=309863&aid=1521490&group_id=9863

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: Build -- unix
Group: bug fix
Status: Open
Resolution: None
Priority: 5
Submitted By: David Hart (dghart)
Assigned to: Nobody/Anonymous (nobody)
Summary: Make wxGetKeyState() work for non-meta keys too

Initial Comment:
It was recently pointed out that the unix version of
wxGetKeyState(), in src/unix/utilsx11.cpp, works only
for metakeys. This patch makes it do what it says on
the label. The important bit is the last three lines;
however I have left in the original code, wrapped in
the IsModifierKey() macro, so that for metakeys the
current behaviour continues: Ctrl, Left & Right Shift,
and Alt work, but Alt-Gr, CapsLock and the Left and
Right Windows keys do not.

All other keys on my standard keyboard are now detected
correctly, except for Power/Sleep/Wake, and Numpad 5
when Numlock is off: these don't work because (afaik)
they have no designated X11 keysyms.

There is a helper function, wxCharCodeWXToX(), which
had some incorrect key translations for keys around the
numpad. I've corrected these, and added the missing
ones for when Numlock is off. I've also done the same
for the (unused!) reverse function, wxCharCodeXToWX().

The diff is against cvs HEAD, but also works adequately
on wxGTK-2.6.3 if you want to backport.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=309863&aid=1521490&group_id=9863




More information about the wx-dev mailing list