summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKaleb Keithley <kaleb@freedesktop.org>2004-03-19 21:49:11 +0000
committerKaleb Keithley <kaleb@freedesktop.org>2004-03-19 21:49:11 +0000
commit74a18beef7f4f4e17fc30b89581d84868cf591ca (patch)
treeed28d1a277707318ed5478b9cb43fa82ecc42ba3
parentd838a30863a993d1cb4d66920c21daa7dbe739e9 (diff)
no bug report. Merge down from -RELEASE-1-TM working left and right Meta,
Alt, Ctrl, and Shift keys. A must have for this release IMNSHO. I'm also going to restore the Credits.rtf edits that Egbert deleted in -CURRENT too. RTF isn't any less human readable than SGML, IMO, and it's a bit unkind to delete credits. (Especially mine. :-)
-rw-r--r--hw/darwin/darwinEvents.c13
-rw-r--r--hw/darwin/darwinKeyboard.c42
-rw-r--r--hw/darwin/quartz/quartzKeyboard.c2
3 files changed, 36 insertions, 21 deletions
diff --git a/hw/darwin/darwinEvents.c b/hw/darwin/darwinEvents.c
index d376624b9..c9f7a925f 100644
--- a/hw/darwin/darwinEvents.c
+++ b/hw/darwin/darwinEvents.c
@@ -3,6 +3,7 @@
*/
/*
Copyright (c) 2002 Torrey T. Lyons. All Rights Reserved.
+Copyright 2004 Kaleb S. KEITHLEY. All Rights Reserved.
This file is based on mieq.c by Keith Packard,
which contains the following copyright:
@@ -108,16 +109,20 @@ static void DarwinUpdateModifiers(
DarwinPressModifierMask(xe, NX_ALPHASHIFTMASK);
}
if (flags & NX_COMMANDMASK) {
- DarwinPressModifierMask(xe, NX_COMMANDMASK);
+ DarwinPressModifierMask(xe,
+ flags & (NX_DEVICELCMDKEYMASK|NX_DEVICERCMDKEYMASK));
}
if (flags & NX_CONTROLMASK) {
- DarwinPressModifierMask(xe, NX_CONTROLMASK);
+ DarwinPressModifierMask(xe,
+ flags & (NX_DEVICELCTLKEYMASK|NX_DEVICERCTLKEYMASK));
}
if (flags & NX_ALTERNATEMASK) {
- DarwinPressModifierMask(xe, NX_ALTERNATEMASK);
+ DarwinPressModifierMask(xe,
+ flags & (NX_DEVICELALTKEYMASK|NX_DEVICERALTKEYMASK));
}
if (flags & NX_SHIFTMASK) {
- DarwinPressModifierMask(xe, NX_SHIFTMASK);
+ DarwinPressModifierMask(xe,
+ flags & (NX_DEVICELSHIFTKEYMASK|NX_DEVICERSHIFTKEYMASK));
}
if (flags & NX_SECONDARYFNMASK) {
DarwinPressModifierMask(xe, NX_SECONDARYFNMASK);
diff --git a/hw/darwin/darwinKeyboard.c b/hw/darwin/darwinKeyboard.c
index 39c5ba58f..904c4068f 100644
--- a/hw/darwin/darwinKeyboard.c
+++ b/hw/darwin/darwinKeyboard.c
@@ -2,6 +2,7 @@
//
// Keyboard support for the Darwin X Server
//
+// Copyright 2004 Kaleb S. KEITHLEY. All Rights Reserved.
// Copyright (c) 2001-2003 Torrey T. Lyons. All Rights Reserved.
// Copyright (c) 2003 Apple Computer, Inc. All Rights Reserved.
//
@@ -684,7 +685,7 @@ DarwinBuildModifierMaps(
break;
case XK_Shift_R:
- info->modifierKeycodes[NX_MODIFIERKEY_SHIFT][1] = i;
+ info->modifierKeycodes[NX_MODIFIERKEY_RSHIFT][0] = i;
info->modMap[MIN_KEYCODE + i] = ShiftMask;
break;
@@ -694,7 +695,7 @@ DarwinBuildModifierMaps(
break;
case XK_Control_R:
- info->modifierKeycodes[NX_MODIFIERKEY_CONTROL][1] = i;
+ info->modifierKeycodes[NX_MODIFIERKEY_RCONTROL][0] = i;
info->modMap[MIN_KEYCODE + i] = ControlMask;
break;
@@ -709,7 +710,7 @@ DarwinBuildModifierMaps(
break;
case XK_Alt_R:
- info->modifierKeycodes[NX_MODIFIERKEY_ALTERNATE][1] = i;
+ info->modifierKeycodes[NX_MODIFIERKEY_RALTERNATE][0] = i;
info->modMap[MIN_KEYCODE + i] = Mod1Mask;
break;
@@ -723,7 +724,7 @@ DarwinBuildModifierMaps(
break;
case XK_Meta_R:
- info->modifierKeycodes[NX_MODIFIERKEY_COMMAND][1] = i;
+ info->modifierKeycodes[NX_MODIFIERKEY_RCOMMAND][0] = i;
info->modMap[MIN_KEYCODE + i] = Mod2Mask;
break;
@@ -750,11 +751,6 @@ DarwinBuildModifierMaps(
break;
}
}
-
-#if ALT_IS_MODE_SWITCH
- if (k[0] == XK_Alt_L || k[0] == XK_Alt_R)
- k[0] = XK_Mode_switch;
-#endif
}
}
@@ -844,14 +840,22 @@ int DarwinModifierNXKeycodeToNXKey(unsigned char keycode, int *outSide)
int DarwinModifierNXMaskToNXKey(int mask)
{
switch (mask) {
- case NX_ALPHASHIFTMASK: return NX_MODIFIERKEY_ALPHALOCK;
- case NX_SHIFTMASK: return NX_MODIFIERKEY_SHIFT;
- case NX_CONTROLMASK: return NX_MODIFIERKEY_CONTROL;
- case NX_ALTERNATEMASK: return NX_MODIFIERKEY_ALTERNATE;
- case NX_COMMANDMASK: return NX_MODIFIERKEY_COMMAND;
- case NX_NUMERICPADMASK: return NX_MODIFIERKEY_NUMERICPAD;
- case NX_HELPMASK: return NX_MODIFIERKEY_HELP;
- case NX_SECONDARYFNMASK: return NX_MODIFIERKEY_SECONDARYFN;
+ case NX_ALPHASHIFTMASK: return NX_MODIFIERKEY_ALPHALOCK;
+ case NX_SHIFTMASK: return NX_MODIFIERKEY_SHIFT;
+ case NX_DEVICELSHIFTKEYMASK: return NX_MODIFIERKEY_SHIFT;
+ case NX_DEVICERSHIFTKEYMASK: return NX_MODIFIERKEY_RSHIFT;
+ case NX_CONTROLMASK: return NX_MODIFIERKEY_CONTROL;
+ case NX_DEVICELCTLKEYMASK: return NX_MODIFIERKEY_CONTROL;
+ case NX_DEVICERCTLKEYMASK: return NX_MODIFIERKEY_RCONTROL;
+ case NX_ALTERNATEMASK: return NX_MODIFIERKEY_ALTERNATE;
+ case NX_DEVICELALTKEYMASK: return NX_MODIFIERKEY_ALTERNATE;
+ case NX_DEVICERALTKEYMASK: return NX_MODIFIERKEY_RALTERNATE;
+ case NX_COMMANDMASK: return NX_MODIFIERKEY_COMMAND;
+ case NX_DEVICELCMDKEYMASK: return NX_MODIFIERKEY_COMMAND;
+ case NX_DEVICERCMDKEYMASK: return NX_MODIFIERKEY_RCOMMAND;
+ case NX_NUMERICPADMASK: return NX_MODIFIERKEY_NUMERICPAD;
+ case NX_HELPMASK: return NX_MODIFIERKEY_HELP;
+ case NX_SECONDARYFNMASK: return NX_MODIFIERKEY_SECONDARYFN;
}
return -1;
}
@@ -865,9 +869,13 @@ int DarwinModifierNXKeyToNXMask(int key)
switch (key) {
case NX_MODIFIERKEY_ALPHALOCK: return NX_ALPHASHIFTMASK;
case NX_MODIFIERKEY_SHIFT: return NX_SHIFTMASK;
+ case NX_MODIFIERKEY_RSHIFT: return NX_SHIFTMASK;
case NX_MODIFIERKEY_CONTROL: return NX_CONTROLMASK;
+ case NX_MODIFIERKEY_RCONTROL: return NX_CONTROLMASK;
case NX_MODIFIERKEY_ALTERNATE: return NX_ALTERNATEMASK;
+ case NX_MODIFIERKEY_RALTERNATE: return NX_ALTERNATEMASK;
case NX_MODIFIERKEY_COMMAND: return NX_COMMANDMASK;
+ case NX_MODIFIERKEY_RCOMMAND: return NX_COMMANDMASK;
case NX_MODIFIERKEY_NUMERICPAD: return NX_NUMERICPADMASK;
case NX_MODIFIERKEY_HELP: return NX_HELPMASK;
case NX_MODIFIERKEY_SECONDARYFN: return NX_SECONDARYFNMASK;
diff --git a/hw/darwin/quartz/quartzKeyboard.c b/hw/darwin/quartz/quartzKeyboard.c
index c434d227f..d6a79b578 100644
--- a/hw/darwin/quartz/quartzKeyboard.c
+++ b/hw/darwin/quartz/quartzKeyboard.c
@@ -69,9 +69,11 @@ const static struct {
{57, XK_Caps_Lock},
{58, XK_Alt_L},
{59, XK_Control_L},
+
{60, XK_Shift_R},
{61, XK_Alt_R},
{62, XK_Control_R},
+ {63, XK_Meta_R},
{122, XK_F1},
{120, XK_F2},