summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2012-07-31 20:21:57 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2012-07-31 20:21:57 (GMT)
commit896992cf6649443a6421ab8448b7e920931cba8c (patch)
tree405c65b70359950c736dac82339b474db8171707
parent35697b9883ec9c6d00bcea66d572bd3c2c2790b1 (diff)
downloadtk-896992cf6649443a6421ab8448b7e920931cba8c.zip
tk-896992cf6649443a6421ab8448b7e920931cba8c.tar.gz
tk-896992cf6649443a6421ab8448b7e920931cba8c.tar.bz2
[Bug 3551802]: Convert from XKeycodeToKeysym to XkbKeycodeToKeysym to fix
deprecation warning.
-rw-r--r--ChangeLog6
-rw-r--r--unix/tkUnixKey.c20
2 files changed, 17 insertions, 9 deletions
diff --git a/ChangeLog b/ChangeLog
index 81cd1f7..f1d79a0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2012-07-31 Donal K. Fellows <dkf@users.sf.net>
+
+ * unix/tkUnixKey.c (TkpSetKeycodeAndState, TkpInitKeymapInfo)
+ (TkpGetKeySym): [Bug 3551802]: Convert from XKeycodeToKeysym to
+ XkbKeycodeToKeysym to fix deprecation warning.
+
2012-07-31 Jan Nijtmans <nijtmans@users.sf.net>
* win/nmakehlp.c: Backport from Tcl 8.6, but add -Q option from
diff --git a/unix/tkUnixKey.c b/unix/tkUnixKey.c
index 8753fdb..ee77cab 100644
--- a/unix/tkUnixKey.c
+++ b/unix/tkUnixKey.c
@@ -11,6 +11,7 @@
*/
#include "tkInt.h"
+#include <X11/XKBlib.h>
/*
* Prototypes for local procedures defined in this file:
@@ -155,7 +156,7 @@ TkpGetString(winPtr, eventPtr, dsPtr)
/*
* When mapping from a keysym to a keycode, need
* information about the modifier state that should be used
- * so that when they call XKeycodeToKeysym taking into
+ * so that when they call XkbKeycodeToKeysym taking into
* account the xkey.state, they will get back the original
* keysym.
*/
@@ -179,7 +180,7 @@ TkpSetKeycodeAndState(tkwin, keySym, eventPtr)
}
if (keycode != 0) {
for (state = 0; state < 4; state++) {
- if (XKeycodeToKeysym(display, keycode, state) == keySym) {
+ if (XkbKeycodeToKeysym(display, keycode, 0, state) == keySym) {
if (state & 1) {
eventPtr->xkey.state |= ShiftMask;
}
@@ -248,7 +249,8 @@ TkpGetKeySym(dispPtr, eventPtr)
&& (eventPtr->xkey.state & LockMask))) {
index += 1;
}
- sym = XKeycodeToKeysym(dispPtr->display, eventPtr->xkey.keycode, index);
+ sym = XkbKeycodeToKeysym(dispPtr->display, eventPtr->xkey.keycode, 0,
+ index);
/*
* Special handling: if the key was shifted because of Lock, but
@@ -263,8 +265,8 @@ TkpGetKeySym(dispPtr, eventPtr)
|| ((sym >= XK_Agrave) && (sym <= XK_Odiaeresis))
|| ((sym >= XK_Ooblique) && (sym <= XK_Thorn)))) {
index &= ~1;
- sym = XKeycodeToKeysym(dispPtr->display, eventPtr->xkey.keycode,
- index);
+ sym = XkbKeycodeToKeysym(dispPtr->display, eventPtr->xkey.keycode,
+ 0, index);
}
}
@@ -274,8 +276,8 @@ TkpGetKeySym(dispPtr, eventPtr)
*/
if ((index & 1) && (sym == NoSymbol)) {
- sym = XKeycodeToKeysym(dispPtr->display, eventPtr->xkey.keycode,
- index & ~1);
+ sym = XkbKeycodeToKeysym(dispPtr->display, eventPtr->xkey.keycode,
+ 0, index & ~1);
}
return sym;
}
@@ -325,7 +327,7 @@ TkpInitKeymapInfo(dispPtr)
if (*codePtr == 0) {
continue;
}
- keysym = XKeycodeToKeysym(dispPtr->display, *codePtr, 0);
+ keysym = XkbKeycodeToKeysym(dispPtr->display, *codePtr, 0, 0);
if (keysym == XK_Shift_Lock) {
dispPtr->lockUsage = LU_SHIFT;
break;
@@ -351,7 +353,7 @@ TkpInitKeymapInfo(dispPtr)
if (*codePtr == 0) {
continue;
}
- keysym = XKeycodeToKeysym(dispPtr->display, *codePtr, 0);
+ keysym = XkbKeycodeToKeysym(dispPtr->display, *codePtr, 0, 0);
if (keysym == XK_Mode_switch) {
dispPtr->modeModMask |= ShiftMask << (i/modMapPtr->max_keypermod);
}