From f2e8ac41c812a29f153f9016918dcde92cc5dfff Mon Sep 17 00:00:00 2001 From: Ray-V Date: Mon, 29 Mar 2021 22:24:47 +0100 Subject: [PATCH] Filter out combining character keysyms to add displayable characters to the lookup table. Signed-off-by: Ray-V --- src/Xutils.cpp | 41 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-) diff --git a/src/Xutils.cpp b/src/Xutils.cpp index 02ea634..850bebd 100644 --- a/src/Xutils.cpp +++ b/src/Xutils.cpp @@ -118,6 +118,42 @@ struct codepair { { 0x02f8, 0x011d }, /* gcircumflex ĝ LATIN SMALL LETTER G WITH CIRCUMFLEX */ { 0x02fd, 0x016d }, /* ubreve ŭ LATIN SMALL LETTER U WITH BREVE */ { 0x02fe, 0x015d }, /* scircumflex ŝ LATIN SMALL LETTER S WITH CIRCUMFLEX */ + { 0x0300, 0x0060 }, /* combining grave ` */ + { 0x0301, 0x00b4 }, /* combining acute ´ */ + { 0x0302, 0x02c6 }, /* combining circumflex above ˆ */ + { 0x0303, 0x02dc }, /* combining tilde above ˜ small tilde */ + { 0x0304, 0x00af }, /* combining macron above ¯ */ + { 0x0306, 0x02d8 }, /* combining breve above ˘ */ + { 0x0307, 0x02d9 }, /* combining dot above ˙ */ + { 0x0308, 0x00a8 }, /* combining diaeresis above ¨ */ + { 0x030a, 0x02da }, /* combining ring above ° */ + { 0x030b, 0x02dd }, /* combining Double Acute ˝ */ + { 0x030c, 0x02c7 }, /* comb Háček/caron above ˇ */ + { 0x030d, 0x02c8 }, /* comb vertical line above ˈ modifier letter vertical line */ + { 0x030f, 0xfffd }, /* combining Double Grave � replacement character, nothing similar */ + { 0x0311, 0x1d54 }, /* combining Inverted Breve ᵔ modifier letter small top half o */ + { 0x0313, 0x1fbf }, /* combining Comma Above ᾽ Greek Psili */ + { 0x0323, 0x002e }, /* combining dot below . period */ + { 0x0324, 0x28c0 }, /* combining diaeresis below ⣀ BRAILLE PATTERN DOTS-78 */ + { 0x0325, 0x02f3 }, /* combining ring below ˳ */ + { 0x0327, 0x00b8 }, /* combining cedilla ¸ */ + { 0x0328, 0x02db }, /* combining ogonek ˛ */ + { 0x032c, 0x02ec }, /* combining Háček/caron below ˬ modifier letter voicing */ + { 0x032d, 0x2038 }, /* combining circumflex below ‸ caret */ + { 0x032e, 0x1d17 }, /* combining breve below ᴗ latin small letter bottom half o */ + { 0x032f, 0x1d16 }, /* comb Inverted Breve Below ᴖ latin small letter top half o */ + { 0x0330, 0x02f7 }, /* combining tilde below ˷ modifier letter low tilde */ + { 0x0331, 0x02cd }, /* combining macron below ˍ modifier letter low macron */ + { 0x0332, 0x005f }, /* combining Low Line _ */ + { 0x0333, 0x2017 }, /* combining Double Low Line ‗ */ + { 0x0335, 0x002d }, /* comb short stroke overlay - hyphen */ + { 0x0336, 0x2500 }, /* comb long stroke overlay ─ box drawings light horizontal */ + { 0x033e, 0x02e2 }, /* combining vertical tilde ˢ modifier letter small s */ + { 0x035c, 0x203f }, /* comb Double Breve Below ‿ undertie */ + { 0x035d, 0xfffd }, /* combining Double Breve � replacement character, nothing similar */ + { 0x035e, 0x203e }, /* comb Yerok/Double Macron ‾ overline */ + { 0x035f, 0x005f }, /* comb Double Macron Below _ Low Line */ + { 0x0360, 0x2053 }, /* combining Double Tilde ⁓ swung dash */ { 0x03a2, 0x0138 }, /* kra ĸ LATIN SMALL LETTER KRA */ { 0x03a3, 0x0156 }, /* Rcedilla Ŗ LATIN CAPITAL LETTER R WITH CEDILLA */ { 0x03a5, 0x0128 }, /* Itilde Ĩ LATIN CAPITAL LETTER I WITH TILDE */ @@ -855,7 +891,10 @@ long keysym2ucs(KeySym keysym) /* also check for directly encoded 24-bit UCS characters */ if ((keysym & 0xff000000) == 0x01000000) { - return keysym & 0x00ffffff; + if (keysym >= 0x01000300 && keysym <= 0x0100036f) // combining characters which don't display + keysym = keysym & 0x0000ffff; // on the keys, so get them from the lookup table + else + return keysym & 0x00ffffff; } /* binary search in table */