keysyms: Fix case mapping for 3 Latin 1 keysyms

Fixed the upper case mappings for:
- XKB_KEY_ydiaeresis
- XKB_KEY_mu
- XKB_KEY_ssharp

Note: In Unicode, the upper case of “ß” (U+00DF) is *not* “ẞ” (U+1E9E)
but “SS”. “ẞ” is reserved for text in capitals.
master
Pierre Le Marre 2023-12-14 15:18:24 +01:00 committed by Wismill
parent c88fe4b692
commit 5c7c79970a
1 changed files with 10 additions and 4 deletions

View File

@ -618,8 +618,6 @@ UCSConvertCase(uint32_t code, xkb_keysym_t *lower, xkb_keysym_t *upper)
*upper = 0x0178; *upper = 0x0178;
else if (code == 0x00b5) /* micro sign */ else if (code == 0x00b5) /* micro sign */
*upper = 0x039c; *upper = 0x039c;
else if (code == 0x00df) /* ssharp */
*upper = 0x1e9e;
return; return;
} }
@ -796,8 +794,8 @@ UCSConvertCase(uint32_t code, xkb_keysym_t *lower, xkb_keysym_t *upper)
static void static void
XConvertCase(xkb_keysym_t sym, xkb_keysym_t *lower, xkb_keysym_t *upper) XConvertCase(xkb_keysym_t sym, xkb_keysym_t *lower, xkb_keysym_t *upper)
{ {
/* Latin 1 keysym */ /* Latin 1 keysym (first part: fast path) */
if (sym < 0x100) { if (sym < 0xb5) {
UCSConvertCase(sym, lower, upper); UCSConvertCase(sym, lower, upper);
return; return;
} }
@ -816,6 +814,14 @@ XConvertCase(xkb_keysym_t sym, xkb_keysym_t *lower, xkb_keysym_t *upper)
*upper = sym; *upper = sym;
switch(sym >> 8) { switch(sym >> 8) {
case 0: /* Latin 1 (second part) */
if (sym == XKB_KEY_mu)
*upper = XKB_KEY_Greek_MU;
else if (sym == XKB_KEY_ydiaeresis)
*upper = XKB_KEY_Ydiaeresis;
else
UCSConvertCase(sym, lower, upper);
break;
case 1: /* Latin 2 */ case 1: /* Latin 2 */
/* Assume the KeySym is a legal value (ignore discontinuities) */ /* Assume the KeySym is a legal value (ignore discontinuities) */
if (sym == XKB_KEY_Aogonek) if (sym == XKB_KEY_Aogonek)