From 8039a6f8cfd99774d4250942c9837c6525f4b22d Mon Sep 17 00:00:00 2001 From: Ilia Ryabokon Date: Mon, 18 Jun 2012 13:55:39 +0300 Subject: [PATCH] Virtual keyboard locale mappings fix --- src/gui/UBKeyboardPalette_linux.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/gui/UBKeyboardPalette_linux.cpp b/src/gui/UBKeyboardPalette_linux.cpp index 7dd1af4d..cc3fda46 100644 --- a/src/gui/UBKeyboardPalette_linux.cpp +++ b/src/gui/UBKeyboardPalette_linux.cpp @@ -216,6 +216,8 @@ void UBKeyboardPalette::onActivated(bool activated) void UBKeyboardPalette::onLocaleChanged(UBKeyboardLocale* locale) { + const int maxMapOffset = 3; //Suppose to have at least 2 keysym groups due to X11 xlib specification + Display *display = XOpenDisplay(0); if(display == NULL) return; @@ -232,7 +234,7 @@ void UBKeyboardPalette::onLocaleChanged(UBKeyboardLocale* locale) KEYCODE& kc = (*locale)[i]->codes[j]; if (!kc.empty()) { - if (kc.modifier <= 5) + if (kc.modifier <= maxMapOffset) keySyms[kc.code * byte_per_code + kc.modifier] = kc.symbol; } @@ -248,10 +250,10 @@ void UBKeyboardPalette::onLocaleChanged(UBKeyboardLocale* locale) KEYCODE& kc = (*locale)[i]->codes[j]; if (!kc.empty()) { - if (kc.modifier > 5) + if (kc.modifier > maxMapOffset) { for(int i1=0; i1