summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordas <das>2006-07-21 06:26:54 (GMT)
committerdas <das>2006-07-21 06:26:54 (GMT)
commit9728e8fdd5475bc74addd754ac7cbd61123cb53a (patch)
tree9fa5fdb82fa0641825d56709626e559810f2b226
parentcf71d3a5ed1a60fa9b35c48c4a3a202eb668a691 (diff)
downloadtk-9728e8fdd5475bc74addd754ac7cbd61123cb53a.zip
tk-9728e8fdd5475bc74addd754ac7cbd61123cb53a.tar.gz
tk-9728e8fdd5475bc74addd754ac7cbd61123cb53a.tar.bz2
* generic/tkBind.c (TkBindInit): for REDO_KEYSYM_LOOKUP, change
keysym-to-string mapping hash to use first name in ks_names.h instead of last (if there are multiple possibilities), e.g. "F11" instead of "L1". * macosx/tkMacOSXKeyboard.c (TkpGetKeySym): correct keysyms for pure modifier key presses [Bugs 700311, 1525905]; correct keysym for Enter key; add keysyms for new NumLock and Fn modifiers (added 2005-08-09).
-rw-r--r--ChangeLog10
-rw-r--r--generic/tkBind.c16
-rw-r--r--macosx/tkMacOSXKeyboard.c23
3 files changed, 32 insertions, 17 deletions
diff --git a/ChangeLog b/ChangeLog
index 622823e..b4ac6cf 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2006-07-21 Daniel Steffen <das@users.sourceforge.net>
+
+ * generic/tkBind.c (TkBindInit): for REDO_KEYSYM_LOOKUP, change
+ keysym-to-string mapping hash to use first name in ks_names.h instead of
+ last (if there are multiple possibilities), e.g. "F11" instead of "L1".
+
+ * macosx/tkMacOSXKeyboard.c (TkpGetKeySym): correct keysyms for pure
+ modifier key presses [Bugs 700311, 1525905]; correct keysym for Enter
+ key; add keysyms for new NumLock and Fn modifiers (added 2005-08-09).
+
2006-07-20 Daniel Steffen <das@users.sourceforge.net>
* macosx/tkMacOSXWm.c (WmAttributesCmd, WmIconbitmapCmd): add support
diff --git a/generic/tkBind.c b/generic/tkBind.c
index 5fd431d..4a969d0 100644
--- a/generic/tkBind.c
+++ b/generic/tkBind.c
@@ -11,7 +11,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkBind.c,v 1.28.2.3 2006/04/11 20:25:43 hobbs Exp $
+ * RCS: @(#) $Id: tkBind.c,v 1.28.2.4 2006/07/21 06:26:54 das Exp $
*/
#include "tkPort.h"
@@ -761,7 +761,7 @@ TkBindInit(mainPtr)
Tcl_HashEntry *hPtr;
ModInfo *modPtr;
EventInfo *eiPtr;
- int dummy;
+ int newEntry;
#ifdef REDO_KEYSYM_LOOKUP
KeySymInfo *kPtr;
@@ -769,23 +769,25 @@ TkBindInit(mainPtr)
Tcl_InitHashTable(&keySymTable, TCL_STRING_KEYS);
Tcl_InitHashTable(&nameTable, TCL_ONE_WORD_KEYS);
for (kPtr = keyArray; kPtr->name != NULL; kPtr++) {
- hPtr = Tcl_CreateHashEntry(&keySymTable, kPtr->name, &dummy);
+ hPtr = Tcl_CreateHashEntry(&keySymTable, kPtr->name, &newEntry);
Tcl_SetHashValue(hPtr, kPtr->value);
hPtr = Tcl_CreateHashEntry(&nameTable, (char *) kPtr->value,
- &dummy);
- Tcl_SetHashValue(hPtr, kPtr->name);
+ &newEntry);
+ if (newEntry) {
+ Tcl_SetHashValue(hPtr, kPtr->name);
+ }
}
#endif /* REDO_KEYSYM_LOOKUP */
Tcl_InitHashTable(&modTable, TCL_STRING_KEYS);
for (modPtr = modArray; modPtr->name != NULL; modPtr++) {
- hPtr = Tcl_CreateHashEntry(&modTable, modPtr->name, &dummy);
+ hPtr = Tcl_CreateHashEntry(&modTable, modPtr->name, &newEntry);
Tcl_SetHashValue(hPtr, modPtr);
}
Tcl_InitHashTable(&eventTable, TCL_STRING_KEYS);
for (eiPtr = eventArray; eiPtr->name != NULL; eiPtr++) {
- hPtr = Tcl_CreateHashEntry(&eventTable, eiPtr->name, &dummy);
+ hPtr = Tcl_CreateHashEntry(&eventTable, eiPtr->name, &newEntry);
Tcl_SetHashValue(hPtr, eiPtr);
}
initialized = 1;
diff --git a/macosx/tkMacOSXKeyboard.c b/macosx/tkMacOSXKeyboard.c
index 2a377ae..6a15e44 100644
--- a/macosx/tkMacOSXKeyboard.c
+++ b/macosx/tkMacOSXKeyboard.c
@@ -9,7 +9,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkMacOSXKeyboard.c,v 1.5.2.5 2006/03/28 02:44:13 das Exp $
+ * RCS: @(#) $Id: tkMacOSXKeyboard.c,v 1.5.2.6 2006/07/21 06:26:54 das Exp $
*/
#include "tkMacOSXInt.h"
@@ -19,15 +19,14 @@
/*
* A couple of simple definitions to make code a bit more self-explaining.
*
- * For the assignments of Mod1==alt==command and Mod2==meta==option, see also
+ * For the assignments of Mod1==meta==command and Mod2==alt==option, see also
* tkMacOSXMouseEvent.c.
*/
#define LATIN1_MAX 255
#define MAC_KEYCODE_MAX 0x7F
#define MAC_KEYCODE_MASK 0x7F
-#undef ALT_MASK
-#define ALT_MASK Mod1Mask
+#define COMMAND_MASK Mod1Mask
#define OPTION_MASK Mod2Mask
@@ -63,7 +62,7 @@ static KeyInfo keyArray[] = {
{0x35, XK_Escape},
{0x47, XK_Clear},
- {0x4C, XK_Return},
+ {0x4C, XK_KP_Enter},
{0x72, XK_Help},
{0x73, XK_Home},
@@ -677,19 +676,23 @@ TkpGetKeySym(
if (eventPtr->xany.send_event == -1) {
int modifier = eventPtr->xkey.keycode;
if (modifier == cmdKey) {
- return XK_Alt_L;
+ return XK_Meta_L;
} else if (modifier == shiftKey) {
return XK_Shift_L;
} else if (modifier == alphaLock) {
return XK_Caps_Lock;
} else if (modifier == optionKey) {
- return XK_Meta_L;
+ return XK_Alt_L;
} else if (modifier == controlKey) {
return XK_Control_L;
+ } else if (modifier == kEventKeyModifierNumLockMask) {
+ return XK_Num_Lock;
+ } else if (modifier == kEventKeyModifierFnMask) {
+ return XK_Super_L;
} else if (modifier == rightShiftKey) {
return XK_Shift_R;
} else if (modifier == rightOptionKey) {
- return XK_Meta_R;
+ return XK_Alt_R;
} else if (modifier == rightControlKey) {
return XK_Control_R;
} else {
@@ -812,8 +815,8 @@ TkpInitKeymapInfo(
* some changes in those scripts. See also bug #700311.
*/
- dispPtr->altModMask = ALT_MASK;
- dispPtr->metaModMask = OPTION_MASK;
+ dispPtr->altModMask = OPTION_MASK;
+ dispPtr->metaModMask = COMMAND_MASK;
#else
dispPtr->altModMask = 0;
dispPtr->metaModMask = 0;