From 885c5afec0135384958c33bab6774da2215f8bab Mon Sep 17 00:00:00 2001 From: fvogel Date: Tue, 7 Jul 2020 20:33:17 +0000 Subject: Fix [09abd739b5]: bind-13.14 fails on Debian 10. --- unix/tkUnixKey.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/unix/tkUnixKey.c b/unix/tkUnixKey.c index f6478ef..668be15 100644 --- a/unix/tkUnixKey.c +++ b/unix/tkUnixKey.c @@ -367,8 +367,18 @@ TkpGetKeySym( index += 1; } - sym = TkKeycodeToKeysym(dispPtr, eventPtr->xkey.keycode, 0, - index); + if (eventPtr->xkey.keycode > 0xff) { + + /* + * X11 keycodes always lie in the inclusive range [8,255]. + */ + + sym = NoSymbol; + return sym; + } else { + sym = TkKeycodeToKeysym(dispPtr, eventPtr->xkey.keycode, 0, + index); + } /* * Special handling: if the key was shifted because of Lock, but lock is -- cgit v0.12 From 02c0e0f004c8958c75dc94c71943cd4b0f46350c Mon Sep 17 00:00:00 2001 From: fvogel Date: Tue, 7 Jul 2020 20:39:19 +0000 Subject: Same fix, code organized differently --- unix/tkUnixKey.c | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/unix/tkUnixKey.c b/unix/tkUnixKey.c index 668be15..757cb0f 100644 --- a/unix/tkUnixKey.c +++ b/unix/tkUnixKey.c @@ -320,6 +320,14 @@ TkpGetKeySym( TkKeyEvent* kePtr = (TkKeyEvent*) eventPtr; /* + * X11 keycodes always lie in the inclusive range [8,255]. + */ + + if (eventPtr->xkey.keycode > 0xff) { + return NoSymbol; + } + + /* * Refresh the mapping information if it's stale. This must happen before * we do any input method processing. [Bug 3599312] */ @@ -366,19 +374,9 @@ TkpGetKeySym( && (eventPtr->xkey.state & LockMask))) { index += 1; } - - if (eventPtr->xkey.keycode > 0xff) { - /* - * X11 keycodes always lie in the inclusive range [8,255]. - */ - - sym = NoSymbol; - return sym; - } else { - sym = TkKeycodeToKeysym(dispPtr, eventPtr->xkey.keycode, 0, - index); - } + sym = TkKeycodeToKeysym(dispPtr, eventPtr->xkey.keycode, 0, + index); /* * Special handling: if the key was shifted because of Lock, but lock is -- cgit v0.12 From 47116a3ec3ac7f6442f634b96a926dec2691285b Mon Sep 17 00:00:00 2001 From: fvogel Date: Tue, 7 Jul 2020 20:41:31 +0000 Subject: Fix blank space --- unix/tkUnixKey.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/unix/tkUnixKey.c b/unix/tkUnixKey.c index 757cb0f..4e150f7 100644 --- a/unix/tkUnixKey.c +++ b/unix/tkUnixKey.c @@ -374,9 +374,9 @@ TkpGetKeySym( && (eventPtr->xkey.state & LockMask))) { index += 1; } - + sym = TkKeycodeToKeysym(dispPtr, eventPtr->xkey.keycode, 0, - index); + index); /* * Special handling: if the key was shifted because of Lock, but lock is -- cgit v0.12