Never handle plain ASCII characters as Unicode
This doesn’t seem to work for compose: The Unicode keysym representing
an ASCII char gets inserted and the kernel waits for another keypress to
be “dead”.
Signed-off-by: Michael Schutte <michi@uiae.at>
Signed-off-by: Alexey Gladkov <legion@altlinux.org>
Michael Schutte authored 14 years ago
Alexey Gladkov committed 14 years ago
1860 | 1860 | |
1861 | 1861 | if (KTYP(code) == KT_META) |
1862 | 1862 | return code; |
1863 | else if (!input_is_unicode && code < 0x80) | |
1864 | /* basic ASCII is fine in every situation */ | |
1865 | return code; | |
1866 | else if (input_is_unicode && (code ^ 0xf000) < 0x80) | |
1867 | /* so is Unicode "Basic Latin" */ | |
1868 | return code ^ 0xf000; | |
1863 | 1869 | else if ((input_is_unicode && direction == TO_UNICODE) || |
1864 | 1870 | (!input_is_unicode && direction == TO_8BIT)) |
1865 | 1871 | /* no conversion necessary */ |
1866 | 1872 | result = code; |
1867 | else if (!input_is_unicode && code < 0x80) | |
1868 | /* convert ASCII chars without looking them up */ | |
1869 | result = (direction == TO_UNICODE) ? (code ^ 0xf000) : code; | |
1870 | else if (input_is_unicode && (code ^ 0xf000) < 0x80) | |
1871 | /* same for Unicode "Basic Latin" */ | |
1872 | result = (direction == TO_UNICODE) ? code : (code ^ 0xf000); | |
1873 | 1873 | else { |
1874 | 1874 | /* depending on direction, this will give us either an 8-bit |
1875 | 1875 | * K(KTYP, KVAL) or a Unicode keysym xor 0xf000 */ |