VirtualBox

Changeset 4716 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Sep 11, 2007 9:35:40 PM (17 years ago)
Author:
vboxsync
Message:

Various fixes to the Wine keyboard code

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/linux/keyboard.c

    r4574 r4716  
    2929#ifdef OUTOFWINE
    3030#include "keyboard_outofwine.h"
    31 int use_xkb = 1;
     31/* I don't see any advantage for us of using Xkb here. The only effect of it in
     32   the code is to cause the keyboard symbols we are looking up to be translated
     33   according to the locale, so that we potentially need additional look-up tables
     34   for ambiguous situations (or the translation can fail if the combination of
     35   locale and keyboard does not match). */
     36int use_xkb = 0;
    3237#endif /* OUTOFWINE defined */
    3338
     
    165170
    166171#ifdef OUTOFWINE
     172/* Not FIXed as it should still work, even though it is completely unnecessary. */
    167173/* What is this supposed to be?  This is just the same as the qwerty layout, with one key
    168174   in a different place. */
     
    275281/* Remember to also add your new table to the layout index table far below! */
    276282
     283#ifndef OUTOFWINE
    277284/*** German Logitech Desktop Pro keyboard layout */
    278285static const char main_key_DE_logitech[MAIN_LEN][4] =
     
    284291 "<>|"
    285292};
     293#endif
    286294
    287295/*** United States keyboard layout (mostly contributed by Uwe Bonnes) */
     
    364372 "aA","sS","dD","fF","gG","hH","jJ","kK","lL","öÖ","äÄ","#'",
    365373 "yY","xX","cC","vV","bB","nN","mM",",;",".:","-_",
     374#ifndef OUTOFWINE
    366375 "<>|"
    367 };
    368 
     376#else
     377 "<>"
     378#endif
     379};
     380
     381#ifndef OUTOFWINE
    369382/*** German keyboard layout without dead keys */
    370383static const char main_key_DE_nodead[MAIN_LEN][4] =
     
    385398 "<>|","yY","xX","cC","vV","bB","nN","mM",",;",".:","-_",
    386399};
     400#endif
    387401
    388402/*** Swiss German keyboard layout (setxkbmap ch -variant de) */
     
    406420};
    407421
     422#ifndef OUTOFWINE
    408423/*** Norwegian keyboard layout (contributed by Ove Kåven) */
    409424static const char main_key_NO[MAIN_LEN][4] =
     
    415430 "<>"
    416431};
     432#else
     433/* innotek FIX */
     434/*** Norwegian keyboard layout (contributed by Ove Kåven) */
     435static const char main_key_NO[MAIN_LEN][4] =
     436{
     437 "|§","1!","2\"","3#","4¤","5%","6&","7/","8(","9)","0=","+?","\\`",
     438 "qQ","wW","eE","rR","tT","yY","uU","iI","oO","pP","åÅ","¨^",
     439 "aA","sS","dD","fF","gG","hH","jJ","kK","lL","øØ","æÆ","'",
     440 "zZ","xX","cC","vV","bB","nN","mM",",;",".:","-_",
     441 "<>"
     442};
     443#endif
    417444
    418445/*** Danish keyboard layout (setxkbmap dk) */
     
    446473};
    447474
     475#ifndef OUTOFWINE
    448476/*** Canadian French keyboard layout (setxkbmap ca_enhanced) */
    449477static const char main_key_CF[MAIN_LEN][4] =
     
    455483 "«»°"
    456484};
     485#endif
    457486
    458487/*** Canadian French keyboard layout (setxkbmap ca -variant fr) */
     
    466495};
    467496
     497#ifndef OUTOFWINE
    468498/*** Canadian keyboard layout (setxkbmap ca) */
    469499static const char main_key_CA[MAIN_LEN][4] =
     
    475505 "ùÙ"
    476506};
     507#else
     508/*** Canadian keyboard layout (setxkbmap ca) */
     509static const char main_key_CA[MAIN_LEN][4] =
     510{
     511 "/\\","1!","2@","3#","4$","5%","6?","7&","8*","9(","0)","-_","=+",
     512 "qQ","wW","eE","rR","tT","yY","uU","iI","oO","pP","^¨","çÇ",
     513 "aA","sS","dD","fF","gG","hH","jJ","kK","lL",";:","èÈ","àÀ",
     514 "zZ","xX","cC","vV","bB","nN","mM",",'",".\"","éÉ",
     515 "ùÙ"
     516};
     517#endif
    477518
    478519/*** Portuguese keyboard layout (setxkbmap pt) */
     
    506547};
    507548
     549#ifndef OUTOFWINE
    508550/*** Bulgarian bds keyboard layout */
    509551static const char main_key_BG_bds[MAIN_LEN][4] =
     
    535577 "zZÑñ","xXÞþ","cCÓó","vVÍí","bB¦¶","nNÔô","mMØø",",<Ââ",".>Àà","/?.,", "<>|¦",
    536578};
    537 
    538 
     579#else
     580/*** Bulgarian bds keyboard layout */
     581static const char main_key_BG_bds[MAIN_LEN][4] =
     582{
     583 "()","1!","2?","3+","4\"","5%","6=","7:","8/","9\xa9","0\xb0","-I",".V",
     584 ",\xd9","\xd5\xf5","\xc5\xe5","\xc9\xe9","\xdb\xfb","\xdd\xfd","\xcb\xeb","\xd3\xf3","\xc4\xe4","\xda\xfa","\xc3\xe3",";\xa7",
     585 "\xd8\xf8","\xd1\xf1","\xc1\xe1","\xcf\xef","\xd6\xf6","\xc7\xe7","\xd4\xf4","\xce\xee","\xd7\xf7","\xcd\xed","\xde\xfe","'\xf9",
     586 "\xc0\xe0","\xca\xea","\xdf\xff","\xdc\xfc","\xc6\xe6","\xc8\xe8","\xd0\xf0","\xd2\xf2","\xcc\xec","\xc2\xe2",
     587 "<>" /* the phantom key */
     588};
     589
     590/*** Bulgarian phonetic keyboard layout */
     591static const char main_key_BG_phonetic[MAIN_LEN][4] =
     592{
     593 "\xde\xfe","1!","2@","3#","4$","5%","6^","7&","8*","9(","0)","-_","=+",
     594 "\xd1\xf1","\xd7\xf7","\xc5\xe5","\xd2\xf2","\xd4\xf4","\xdf\xff","\xd5\xf5","\xc9\xe9","\xcf\xef","\xd0\xf0","\xdb\xfb","\xdd\xfd",
     595 "\xc1\xe1","\xd3\xf3","\xc4\xe4","\xc6\xe6","\xc7\xe7","\xc8\xe8","\xca\xea","\xcb\xeb","\xcc\xec",";:","'\"","\xc0\xe0",
     596 "\xda\xfa","\xd8\xf8","\xc3\xe3","\xd6\xf6","\xc2\xe2","\xce\xee","\xcd\xed",",<",".>","/?",
     597 "<>" /* the phantom key */
     598};
     599
     600/*** Belarusian standard keyboard layout (contributed by Hleb Valoska) */
     601/*** It matches belarusian layout for XKB from Alexander Mikhailian    */
     602static const char main_key_BY[MAIN_LEN][4] =
     603{
     604 "£³","1!","2\"","3#","4;","5%","6:","7?","8*","9(","0)","-_","=+",
     605 "Êê","Ãã","Õõ","Ëë","Åå","Îî","Çç","Ûû","®¾","Úú","Èè","''",
     606 "Ææ","Ùù","×÷","Áá","Ðð","Òò","Ïï","Ìì","Ää","Öö","Üü","/|",
     607 "Ññ","Þþ","Óó","Íí","¦¶","Ôô","Øø","Ââ","Àà",".,", "|¦",
     608};
     609#endif
     610
     611
     612#ifndef OUTOFWINE
    539613/*** Russian keyboard layout (contributed by Pavel Roskin) */
    540614static const char main_key_RU[MAIN_LEN][4] =
     
    565639 "<>" /* the phantom key */
    566640};
    567 
     641#else
     642/*** Russian keyboard layout KOI8-R */
     643static const char main_key_RU_koi8r[MAIN_LEN][4] =
     644{
     645 "£³","1!","2\"","3#","4*","5:","6,","7.","8;","9(","0)","-_","=+",
     646 "Êê","Ãã","Õõ","Ëë","Åå","Îî","Çç","Ûû","Ýý","Úú","Èè","ßÿ",
     647 "Ææ","Ùù","×÷","Áá","Ðð","Òò","Ïï","Ìì","Ää","Öö","Üü","\\|",
     648 "Ññ","Þþ","Óó","Íí","Éé","Ôô","Øø","Ââ","Àà","/?",
     649 "/|" /* the phantom key */
     650};
     651#endif
     652
     653#ifndef OUTOFWINE
    568654/*** Russian keyboard layout cp1251 */
    569655static const char main_key_RU_cp1251[MAIN_LEN][4] =
     
    585671 "<>" /* the phantom key */
    586672};
    587 
     673#else
     674/*** Russian phonetic keyboard layout */
     675static const char main_key_RU_phonetic[MAIN_LEN][4] =
     676{
     677 "Àà","1!","2@","3£","4³","5ß","6ÿ","7&","8*","9(","0)","-_","Þþ",
     678 "Ññ","×÷","Åå","Òò","Ôô","Ùù","Õõ","Éé","Ïï","Ðð","Ûû","Ýý",
     679 "Áá","Óó","Ää","Ææ","Çç","Èè","Êê","Ëë","Ìì",";:","'\"","Üü",
     680 "Úú","Øø","Ãã","Öö","Ââ","Îî","Íí",",<",".>","/?",
     681 "|¦" /* the phantom key */
     682};
     683#endif
     684
     685#ifndef OUTOFWINE
    588686/*** Ukrainian keyboard layout KOI8-U */
    589687static const char main_key_UA[MAIN_LEN][4] =
     
    595693 "<>" /* the phantom key */
    596694};
     695#else
     696/*** Ukrainian keyboard layout KOI8-U */
     697static const char main_key_UA[MAIN_LEN][4] =
     698{
     699 "­½","1!","2\"","3#","4*","5:","6,","7.","8;","9(","0)","-_","=+",
     700 "Êê","Ãã","Õõ","Ëë","Åå","Îî","Çç","Ûû","Ýý","Úú","Èè","§·",
     701 "Ææ","¦¶","×÷","Áá","Ðð","Òò","Ïï","Ìì","Ää","Öö","¤´","\\|",
     702 "Ññ","Þþ","Óó","Íí","Éé","Ôô","Øø","Ââ","Àà","/?",
     703 "<>" /* the phantom key */
     704};
     705#endif
    597706
    598707/*** Ukrainian keyboard layout KOI8-U by O. Nykyforchyn */
     
    9321041};
    9331042
     1043#ifndef OUTOFWINE
    9341044/*** Thai (Kedmanee) keyboard layout by Supphachoke Suntiwichaya <[email protected]> */
    9351045static const char main_key_th[MAIN_LEN][4] =
     
    9401050 "zZ¼(","xX»)","cCá©","vVÍÎ","bBÚ","nN×ì","mM·?",",<Á²",".>ãÌ","/?½Æ"
    9411051};
     1052#else
     1053/*** Thai (Kedmanee) keyboard layout by Supphachoke Suntiwichaya <[email protected]> */
     1054static const char main_key_th[MAIN_LEN][4] =
     1055{
     1056 "_%","å+","/ñ","-ò","Àó","¶ô","ØÙ","Öß","¤õ","µö","¨÷","¢ø","ªù",
     1057 "æð","ä\"","Ó®","¾±","и","Ñí","Õê","ó","¹Ï","­","º°","Å,",
     1058 "¿Ä","˦","¡¯","´â","à¬","éç","èë","ÒÉ","ÊÈ","Ç«","§.","£¥",
     1059 "¼(","»)","á©","ÍÎ","\xd4\xda","×ì","·?","Á²","ãÌ","½Æ",
     1060 "<>" /* The phantom key. */
     1061};
     1062#endif
    9421063
    9431064/*** VNC keyboard layout */
     
    9971118 {0x0809, "British keyboard layout", &main_key_UK, &main_key_scan_qwerty, &main_key_vkey_qwerty},
    9981119 {0x0407, "German keyboard layout", &main_key_DE, &main_key_scan_qwerty, &main_key_vkey_qwertz},
     1120#ifndef OUTOFWINE
    9991121 {0x0407, "German keyboard layout without dead keys", &main_key_DE_nodead, &main_key_scan_qwerty, &main_key_vkey_qwertz},
    10001122 {0x0407, "German keyboard layout for logitech desktop pro", &main_key_DE_logitech,  &main_key_scan_qwerty, &main_key_vkey_qwertz},
    10011123 {0x0407, "German keyboard layout without dead keys 105", &main_key_DE_nodead_105, &main_key_scan_qwerty, &main_key_vkey_qwertz_105},
     1124#endif
    10021125 {0x0807, "Swiss German keyboard layout", &main_key_SG, &main_key_scan_qwerty, &main_key_vkey_qwertz},
    10031126 {0x100c, "Swiss French keyboard layout", &main_key_SF, &main_key_scan_qwerty, &main_key_vkey_qwertz},
     
    10071130 {0x0406, "Danish keyboard layout", &main_key_DA, &main_key_scan_qwerty, &main_key_vkey_qwerty},
    10081131 {0x040c, "French keyboard layout", &main_key_FR, &main_key_scan_qwerty, &main_key_vkey_azerty},
     1132#ifndef OUTOFWINE
    10091133 {0x0c0c, "Canadian French keyboard layout", &main_key_CF, &main_key_scan_qwerty, &main_key_vkey_qwerty},
     1134#endif
    10101135 {0x0c0c, "Canadian French keyboard layout (CA_fr)", &main_key_CA_fr, &main_key_scan_qwerty, &main_key_vkey_qwerty},
    10111136 {0x0c0c, "Canadian keyboard layout", &main_key_CA, &main_key_scan_qwerty, &main_key_vkey_qwerty},
     
    10181143 {0x0402, "Bulgarian phonetic keyboard layout", &main_key_BG_phonetic, &main_key_scan_qwerty, &main_key_vkey_qwerty},
    10191144 {0x0423, "Belarusian keyboard layout", &main_key_BY, &main_key_scan_qwerty, &main_key_vkey_qwerty},
     1145#ifndef OUTOFWINE
    10201146 {0x0419, "Russian keyboard layout", &main_key_RU, &main_key_scan_qwerty, &main_key_vkey_qwerty},
    10211147 {0x0419, "Russian keyboard layout (phantom key version)", &main_key_RU_phantom, &main_key_scan_qwerty, &main_key_vkey_qwerty},
     1148#endif
    10221149 {0x0419, "Russian keyboard layout KOI8-R", &main_key_RU_koi8r, &main_key_scan_qwerty, &main_key_vkey_qwerty},
     1150#ifndef OUTOFWINE
    10231151 {0x0419, "Russian keyboard layout cp1251", &main_key_RU_cp1251, &main_key_scan_qwerty, &main_key_vkey_qwerty},
     1152#endif
    10241153 {0x0419, "Russian phonetic keyboard layout", &main_key_RU_phonetic, &main_key_scan_qwerty, &main_key_vkey_qwerty},
    10251154 {0x0422, "Ukrainian keyboard layout KOI8-U", &main_key_UA, &main_key_scan_qwerty, &main_key_vkey_qwerty},
     
    16881817#endif
    16891818            {
     1819#ifndef OUTOFWINE
    16901820                TRACE("XKB could not translate keysym %ld\n", keysym);
     1821#endif
    16911822                /* FIXME: query what keysym is used as Mode_switch, fill XKeyEvent
    16921823                 * with appropriate ShiftMask and Mode_switch, use XLookupString
     
    17531884          for (i = 0; i < 4; i++) str[i] = ckey[keyc][i] ? ckey[keyc][i] : ' ';
    17541885          str[4] = 0;
     1886#ifndef OUTOFWINE
    17551887          TRACE_(key)("mismatch for keysym 0x%04lX, keycode %d, got %s\n", keysym, keyc, str );
     1888#else
     1889          TRACE_(key)("mismatch for keycode %d, got %s (0x%.2hx 0x%.2hx)\n",
     1890                       keyc, str, str[0], str[1]);
     1891#endif
    17561892          mismatch++;
    17571893          score -= syms;
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette