summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--win/tkWinKey.c23
1 files changed, 13 insertions, 10 deletions
diff --git a/win/tkWinKey.c b/win/tkWinKey.c
index 9ab4c5f..af826d5 100644
--- a/win/tkWinKey.c
+++ b/win/tkWinKey.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: tkWinKey.c,v 1.5 1999/10/29 03:58:39 hobbs Exp $
+ * RCS: @(#) $Id: tkWinKey.c,v 1.6 1999/10/30 09:16:07 hobbs Exp $
*/
#include "tkWinInt.h"
@@ -228,16 +228,11 @@ XKeysymToKeycode(display, keysym)
Keys* key;
SHORT result;
- if (keysym >= 0x20) {
- result = VkKeyScan((char) keysym);
- if (result != -1) {
- return (KeyCode) (result & 0xff);
- }
- }
-
/*
- * Couldn't map the character to a virtual keycode, so do a
- * table lookup.
+ * We check our private map first for a virtual keycode,
+ * as VkKeyScan will return values that don't map to X
+ * for the "extended" Syms. This may be due to just casting
+ * problems below, but this works.
*/
for (key = keymap; key->keycode != 0; key++) {
@@ -245,6 +240,14 @@ XKeysymToKeycode(display, keysym)
return key->keycode;
}
}
+
+ if (keysym >= 0x20) {
+ result = VkKeyScan((char) keysym);
+ if (result != -1) {
+ return (KeyCode) (result & 0xfff);
+ }
+ }
+
return 0;
}