summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhobbs <hobbs>1999-10-30 09:16:07 (GMT)
committerhobbs <hobbs>1999-10-30 09:16:07 (GMT)
commitbd117472d6c9557a44c321e2eb5c1df992e58bf8 (patch)
treedd68807ea4aded9d7ba2110530e0812e1285861e
parent242938d0a68c04c5687156c1a655a488bab01e76 (diff)
downloadtk-bd117472d6c9557a44c321e2eb5c1df992e58bf8.zip
tk-bd117472d6c9557a44c321e2eb5c1df992e58bf8.tar.gz
tk-bd117472d6c9557a44c321e2eb5c1df992e58bf8.tar.bz2
* win/tkWinKey.c: fixed XKeysymToKeycode to handle mapping of
symbolic keysyms (Left, Home, ...) with event generate
-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;
}