From 116005d64fc1e85b3490db554acb3248dbe4ad26 Mon Sep 17 00:00:00 2001 From: crs Date: Wed, 29 Jan 2003 22:16:40 +0000 Subject: [PATCH] To support keymaps with only upper (or lower) case keysyms we now use Xlib to convert an unmatched keysym to upper and lower case and use whichever, if any, is not the same as the original keysym. This supports case conversion in any language that Xlib supports it in. --- lib/platform/CXWindowsSecondaryScreen.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/lib/platform/CXWindowsSecondaryScreen.cpp b/lib/platform/CXWindowsSecondaryScreen.cpp index 1bacd828..801627e6 100644 --- a/lib/platform/CXWindowsSecondaryScreen.cpp +++ b/lib/platform/CXWindowsSecondaryScreen.cpp @@ -28,7 +28,6 @@ # include # define XK_MISCELLANY # define XK_XKB_KEYS -# define XK_LATIN1 # include # if defined(HAVE_X11_EXTENSIONS_XTEST_H) # include @@ -1269,14 +1268,15 @@ CXWindowsSecondaryScreen::findKey(KeyID id, KeyModifierMask& mask) const // find the keycodes that generate the keysym KeyCodeIndex index = m_keycodeMap.find(keysym); - if (index == noKey() && keysym >= XK_a && keysym <= XK_z) { - // for an unfound lower case alpha, try the equivalent upper - // case (as some keymaps only include the upper case, notably - // Sun Solaris). - // Note that this depends on the keysyms for 'a' through 'z' - // and 'A' through 'Z' being contiguous. This is currently - // the case and extremely unlikely to change. - index = m_keycodeMap.find(keysym + XK_A - XK_a); + if (index == noKey()) { + // try upper/lower case (as some keymaps only include the + // upper case, notably Sun Solaris). + KeySym lower, upper; + XConvertCase(keysym, &lower, &upper); + if (lower != keysym) + index = m_keycodeMap.find(lower); + else if (upper != keysym) + index = m_keycodeMap.find(upper); } if (index == noKey()) { // try backup keysym for certain keys (particularly the numpad