Right Arrow does not function for some regional settings (1 Viewer)

smallishzulu

Portal Pro
December 25, 2006
83
0
Istanbul
Home Country
Turkey Turkey
Hi all,

There is an interesting situation for some regional settings under Windows XP. For example, I live in Turkey and my regional settings are for Turkey as seen in the attachments.

In this case; when I try to use MediaPortal I can not use right arrow. However, if I change my settings to USA / English. Then there is no problem.

I studied on keypress and keydown events in MediaPortal.cs and it catches the key with 39 Key Code for both regional settings.

But in Turkish settings, the below conditional generates always false:

Line 2243:

if (ActionTranslator.GetAction(GUIWindowManager.ActiveWindowEx, key, ref action))
{
if (action.SoundFileName.Length > 0 && !g_Player.Playing)
{
Utils.PlaySound(action.SoundFileName, false, true);
}
GUIGraphicsContext.OnAction(action);
}

Also, the keymap.xml is in ISO-8859-1 standard. If I set it to UTF8, nothing works.

:oops:
 

smallishzulu

Portal Pro
December 25, 2006
83
0
Istanbul
Home Country
Turkey Turkey
Keymap.xml

Hi all,

I have attached a debug screenshot. As you will see for Turkish regional settings MediaPortal can not correctly read keymap.xml.
 

ronilse

Retired Team Member
  • Premium Supporter
  • July 19, 2005
    4,422
    283
    Moss
    Home Country
    Norway Norway
    Hi,

    Dunno if you have followed previous discussions about languages & XP bugs. The letter "i" has a bug in your language & the "dot" above the letter it's missing when translated between English & your language & causing lots of troubles & it could be other things that doesn't translate correct.

    Regards
    Roy
     

    smallishzulu

    Portal Pro
    December 25, 2006
    83
    0
    Istanbul
    Home Country
    Turkey Turkey
    You will find the fix below:

    ActionTranslator.cs / Line: 219 to 250

    //strButton = strButton.ToUpper(); // A lovely touch from Turkey
    strButton = strButton.ToLower();
    if (strButton == "f1") but.eKeyCode = (int)Keys.F1;
    if (strButton == "f2") but.eKeyCode = (int)Keys.F2;
    if (strButton == "f3") but.eKeyCode = (int)Keys.F3;
    if (strButton == "f4") but.eKeyCode = (int)Keys.F4;
    if (strButton == "f5") but.eKeyCode = (int)Keys.F5;
    if (strButton == "f6") but.eKeyCode = (int)Keys.F6;
    if (strButton == "f7") but.eKeyCode = (int)Keys.F7;
    if (strButton == "f8") but.eKeyCode = (int)Keys.F8;
    if (strButton == "f9") but.eKeyCode = (int)Keys.F9;
    if (strButton == "f10") but.eKeyCode = (int)Keys.F10;
    if (strButton == "f11") but.eKeyCode = (int)Keys.F11;
    if (strButton == "f12") but.eKeyCode = (int)Keys.F12;
    if (strButton == "backspace") but.eKeyCode = (int)Keys.Back;
    if (strButton == "tab") but.eKeyCode = (int)Keys.Tab;
    if (strButton == "end") but.eKeyCode = (int)Keys.End;
    if (strButton == "insert") but.eKeyCode = (int)Keys.Insert;
    if (strButton == "home") but.eKeyCode = (int)Keys.Home;
    if (strButton == "pageup") but.eKeyCode = (int)Keys.PageUp;
    if (strButton == "pagedown") but.eKeyCode = (int)Keys.PageDown;
    if (strButton == "left") but.eKeyCode = (int)Keys.Left;
    if (strButton == "right") but.eKeyCode = (int)Keys.Right;
    if (strButton == "up") but.eKeyCode = (int)Keys.Up;
    if (strButton == "down") but.eKeyCode = (int)Keys.Down;
    if (strButton == "enter") but.eKeyCode = (int)Keys.Enter;
    if (strButton == "delete") but.eKeyCode = (int)Keys.Delete;
    if (strButton == "pause") but.eKeyCode = (int)Keys.Pause;
    if (strButton == "print") but.eKeyCode = (int)Keys.PrintScreen;
    if (strButton == "escape") but.eKeyCode = (int)Keys.Escape;
    if (strButton == "esc") but.eKeyCode = (int)Keys.Escape;
    if (strButton == "space")
     

    ronilse

    Retired Team Member
  • Premium Supporter
  • July 19, 2005
    4,422
    283
    Moss
    Home Country
    Norway Norway
    Hi,
    But shouldn't this converting between languages be fixed by M$, we have lots of use in other parts of the code which can brake it too(please post patches to sourceforge)?

    Regards
    Roy
     

    smallishzulu

    Portal Pro
    December 25, 2006
    83
    0
    Istanbul
    Home Country
    Turkey Turkey
    I only changed the special keys part in ActionTranslator. Also, it was written with toUpper() method to avoid any case sensivity problem in reading data. It could be also written using toLower(). That also would give the same result. Programaticaly same. But using toLower() method will additionally avoid charachter problems too. I will send a patch to SF.
     

    rtv

    Retired Team Member
  • Premium Supporter
  • April 7, 2005
    3,622
    301
    Osnabruck
    Home Country
    Germany Germany
    It's "in". I am just curious how long you'll need to step into the next bug using a localized Windows :)
     

    Users who are viewing this thread

    Top Bottom