Commit 8039a6f8 authored by Ilia Ryabokon's avatar Ilia Ryabokon

Virtual keyboard locale mappings fix

parent c7d95fe3
......@@ -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<SYMBOL_KEYS_COUNT; i1++)
for(int j1=0; j1<=5; j1++)
for(int j1=0; j1<=maxMapOffset; j1++)
if (keySyms[i1 * byte_per_code + j1]==NoSymbol)
{
kc.code =i1;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment