XKBCvt: remove an if that never gets triggered

The 'if' at the beginning of _XkbHandleSpecialSym() allows only symbols
from the numeric keypad and some control symbols to pass -- XK_hyphen
is not among them, so the check for XK_hyphen in the later 'if' will
always be false.

(The corresponding conversion in _XTranslateKeySym() in KeyBind.c was
removed in March 1994.)

(Also, several keyboard layouts nowadays contain the 'hyphen' symbol,
allowing the user to enter soft hyphens into a document.  So we really
don't want to remap this symbol.)

Fixes issue #48.

Reported-by: Bhavi Dhingra

Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
This commit is contained in:
Benno Schulenberg 2022-01-26 16:55:50 +01:00
parent 6786744f63
commit fbbc3cf8b8

View file

@ -75,8 +75,6 @@ _XkbHandleSpecialSym(KeySym keysym, char *buffer, int nbytes, int *extra_rtrn)
/* if X keysym, convert to ascii by grabbing low 7 bits */
if (keysym == XK_KP_Space)
buffer[0] = XK_space & 0x7F; /* patch encoding botch */
else if (keysym == XK_hyphen)
buffer[0] = (char) (XK_minus & 0xFF); /* map to equiv character */
else
buffer[0] = (char) (keysym & 0x7F);
return 1;