summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordonal.k.fellows@manchester.ac.uk <dkf>2012-07-31 20:24:39 (GMT)
committerdonal.k.fellows@manchester.ac.uk <dkf>2012-07-31 20:24:39 (GMT)
commit8da150002f58cc5469c3dc126080ac351827128b (patch)
tree865d1144fdcc230f824f31d8db4b272347b5a2c0
parent01a7920da35eade0ecf9f4af82990790b5137d1b (diff)
parent144e11366e793aa0c19d1441735e8b1082aafcd1 (diff)
downloadtk-8da150002f58cc5469c3dc126080ac351827128b.zip
tk-8da150002f58cc5469c3dc126080ac351827128b.tar.gz
tk-8da150002f58cc5469c3dc126080ac351827128b.tar.bz2
[Bug 3551802]: Convert from XKeycodeToKeysym to XkbKeycodeToKeysym to fix
deprecation warning.
-rw-r--r--ChangeLog6
-rw-r--r--unix/tkUnixKey.c22
2 files changed, 18 insertions, 10 deletions
diff --git a/ChangeLog b/ChangeLog
index 9104aee..ff43dfb 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 030e472..ed77877 100644
--- a/unix/tkUnixKey.c
+++ b/unix/tkUnixKey.c
@@ -11,6 +11,7 @@
*/
#include "tkInt.h"
+#include <X11/XKBlib.h>
/*
* Prototypes for local functions defined in this file:
@@ -211,8 +212,8 @@ TkpGetString(
/*
* 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 account the xkey.state, they will get back the original keysym.
+ * modifier state to be used so that when they call XkbKeycodeToKeysym taking
+ * into account the xkey.state, they will get back the original keysym.
*/
void
@@ -234,7 +235,7 @@ TkpSetKeycodeAndState(
}
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;
}
@@ -324,7 +325,8 @@ TkpGetKeySym(
&& (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 lock is
@@ -338,8 +340,8 @@ TkpGetKeySym(
|| ((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);
}
}
@@ -349,8 +351,8 @@ TkpGetKeySym(
*/
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;
}
@@ -399,7 +401,7 @@ TkpInitKeymapInfo(
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;
@@ -425,7 +427,7 @@ TkpInitKeymapInfo(
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);
}