summaryrefslogtreecommitdiff
path: root/hw/xquartz/darwinEvents.c
diff options
context:
space:
mode:
authorJeremy Huddleston <jeremyhu@freedesktop.org>2008-12-31 12:40:02 -0800
committerJeremy Huddleston <jeremyhu@freedesktop.org>2008-12-31 12:45:34 -0800
commit2f361186f93a791e446c4a9471bb0c3b9b818d98 (patch)
treec358c2c920dab9565da53514c3cb0350f2700811 /hw/xquartz/darwinEvents.c
parenta2abaa9fd3a5ad713c1f946e9d7f598825ad3a84 (diff)
XQuartz: Don't use NX_SECONDARYFNMASK, NX_NUMERICPADMASK, NX_HELPMASK
We don't have keycodes for them, so don't try to use them (cherry picked from commit cb912aca3a2834c4ad8e386c8a0d05c1bb31b0e7)
Diffstat (limited to 'hw/xquartz/darwinEvents.c')
-rw-r--r--hw/xquartz/darwinEvents.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/hw/xquartz/darwinEvents.c b/hw/xquartz/darwinEvents.c
index 0ecc17038..9a9483181 100644
--- a/hw/xquartz/darwinEvents.c
+++ b/hw/xquartz/darwinEvents.c
@@ -145,7 +145,6 @@ static void DarwinPressModifierKey(int pressed, int key) {
*/
static int modifier_mask_list[] = {
- NX_SECONDARYFNMASK, NX_NUMERICPADMASK, NX_HELPMASK,
#ifdef NX_DEVICELCMDKEYMASK
NX_DEVICELCTLKEYMASK, NX_DEVICERCTLKEYMASK,
NX_DEVICELSHIFTKEYMASK, NX_DEVICERSHIFTKEYMASK,
@@ -162,6 +161,7 @@ static void DarwinUpdateModifiers(
int flags ) // modifier flags that have changed
{
int *f;
+ int key;
/* Capslock is special. This mask is the state of capslock (on/off),
* not the state of the button. Hopefully we can find a better solution.
@@ -172,8 +172,13 @@ static void DarwinUpdateModifiers(
}
for(f=modifier_mask_list; *f; f++)
- if(*f & flags)
- DarwinPressModifierKey(pressed, DarwinModifierNXMaskToNXKey(*f));
+ if(*f & flags) {
+ key = DarwinModifierNXMaskToNXKey(*f);
+ if(key == -1)
+ ErrorF("DarwinUpdateModifiers: Unsupported NXMask: 0x%x\n", *f);
+ else
+ DarwinPressModifierKey(pressed, key);
+ }
}
/* Generic handler for Xquartz-specifc events. When possible, these should