From 1818e98f85c25d23abd204d5554734eaf435d308 Mon Sep 17 00:00:00 2001 From: dkf Date: Tue, 31 Jul 2012 14:47:12 +0000 Subject: [Bug 3551802]: Convert from XKeycodeToKeysym to XkbKeycodeToKeysym to fix deprecation warning. --- ChangeLog | 6 ++++++ unix/tkUnixKey.c | 22 ++++++++++++---------- 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2c5f0e7..0a98897 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2012-07-31 Donal K. Fellows + + * unix/tkUnixKey.c (TkpSetKeycodeAndState, TkpInitKeymapInfo) + (TkpGetKeySym): [Bug 3551802]: Convert from XKeycodeToKeysym to + XkbKeycodeToKeysym to fix deprecation warning. + 2012-07-31 Jan Nijtmans * win/nmakehlp.c: Backport from Tcl 8.6, but add -Q option from diff --git a/unix/tkUnixKey.c b/unix/tkUnixKey.c index 7461d75..b3f5b93 100644 --- a/unix/tkUnixKey.c +++ b/unix/tkUnixKey.c @@ -11,6 +11,7 @@ */ #include "tkInt.h" +#include /* * Prototypes for local functions defined in this file: @@ -210,8 +211,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 tp be used so that when they call XkbKeycodeToKeysym taking + * into account the xkey.state, they will get back the original keysym. */ void @@ -230,7 +231,7 @@ TkpSetKeycodeAndState( keycode = XKeysymToKeycode(display, keySym); 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; } @@ -320,7 +321,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 @@ -334,8 +336,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); } } @@ -345,8 +347,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; } @@ -395,7 +397,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; @@ -421,7 +423,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); } -- cgit v0.12