- Timestamp:
- May 8, 2007 8:47:31 AM (18 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/Makefile.kmk
r2478 r2529 148 148 src/VBoxFBDDRAW.cpp 149 149 150 ifdef XKEYBOARD_NEW151 VirtualBox_SOURCES.linux = \152 src/linux/XKeyboardNew.cpp153 else154 150 VirtualBox_SOURCES.linux = \ 155 151 src/linux/XKeyboard.cpp \ 156 src/linux/keyboard.c 157 endif 152 src/linux/keyboard.c \ 153 src/linux/XKeyboardNew.cpp 158 154 159 155 VirtualBox_SOURCES.darwin = \ -
trunk/src/VBox/Frontends/VirtualBox/include/XKeyboard.h
r382 r2529 44 44 int getKeysymsPerKeycode(); 45 45 46 // initialize the X keyboard subsystem, safe for use on remote X servers 47 bool initXKeyboardSafe(Display *dpy); 48 // our custom keyboard handler, safe for use on remote X servers 49 void handleXKeyEventSafe(Display *dpy, XEvent *event, WINEKEYBOARDINFO *wineKbdInfo); 50 // returns the number of keysyms per keycode (only valid after initXKeyboard()), safe 51 // for use on remote X servers 52 int getKeysymsPerKeycodeSafe(); 53 46 54 47 55 #endif // __XKeyboard_h__ -
trunk/src/VBox/Frontends/VirtualBox/src/linux/XKeyboard.cpp
r382 r2529 51 51 * within our environment. 52 52 */ 53 bool initXKeyboard (Display *dpy)53 bool initXKeyboardSafe(Display *dpy) 54 54 { 55 55 // update the global display pointer … … 63 63 * possible to undo the dreaded scancode to X11 conversion. Sigh! 64 64 */ 65 void handleXKeyEvent (Display *dpy, XEvent *event, WINEKEYBOARDINFO *wineKbdInfo)65 void handleXKeyEventSafe(Display *dpy, XEvent *event, WINEKEYBOARDINFO *wineKbdInfo) 66 66 { 67 67 // update the global display pointer … … 71 71 } 72 72 73 int getKeysymsPerKeycode ()73 int getKeysymsPerKeycodeSafe() 74 74 { 75 75 return X11DRV_GetKeysymsPerKeycode(); -
trunk/src/VBox/Frontends/VirtualBox/src/linux/XKeyboardNew.cpp
r1558 r2529 24 24 #include <XKeyboard.h> 25 25 #include <cstring> 26 #include <cstdlib> 26 27 27 28 #define LOG_GROUP LOG_GROUP_GUI … … 53 54 54 55 static int keysyms_per_keycode; /** Number of keyboard language layouts the host has */ 56 static bool remote_display = false; /** Are we displaying on a remote X server? */ 55 57 56 58 /** 57 * Find out how many different language mappings there are for this keyboard. This is needed 59 * Check whether we are running on a local or on a remote X server, and find out how many 60 * different language mappings there are for this keyboard. This last is needed 58 61 * so that Dmitry can press <hostkey>+Q while using his Cyrillic keyboard layout :) 59 62 */ … … 62 65 int min, max; 63 66 KeySym *syms; 67 68 /* If we are displaying on a remote display then fall back to old Wine-based code. */ 69 if (DisplayString(dpy)[0] != ':') 70 { 71 remote_display = true; 72 Log(("initXKeyboard: remote display detected\n")); 73 return initXKeyboardSafe(dpy); 74 } 75 Log(("initXKeyboard: remote display not detected\n")); 64 76 /* Find out how approximately how many keys there are on the keyboard, needed for the next 65 77 call */ … … 76 88 * Convert X11 keycodes back to scancodes. 77 89 */ 78 void handleXKeyEvent(Display * /* dpy */, XEvent *event, WINEKEYBOARDINFO *wineKbdInfo)90 void handleXKeyEvent(Display * dpy, XEvent *event, WINEKEYBOARDINFO *wineKbdInfo) 79 91 { 80 92 unsigned int uKeyCode = event->xkey.keycode; 93 94 if (remote_display == true) 95 { 96 handleXKeyEventSafe(dpy, event, wineKbdInfo); 97 return; 98 } 81 99 memset(reinterpret_cast<void *>(wineKbdInfo), 0, sizeof(WINEKEYBOARDINFO)); 82 100 /* Basic scancodes are translated to keycodes by adding 8, so we just subtract again. */ … … 107 125 int getKeysymsPerKeycode() 108 126 { 127 if (remote_display == true) 128 return getKeysymsPerKeycodeSafe(); 109 129 return keysyms_per_keycode; 110 130 } -
trunk/src/VBox/Frontends/VirtualBox/src/linux/keyboard.c
r382 r2529 21 21 * You should have received a copy of the GNU Lesser General Public 22 22 * License along with this library; if not, write to the Free Software 23 * Foundation, Inc., 5 9 Temple Place, Suite 330, Boston, MA 02111-1307USA23 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA 24 24 */ 25 26 // our master define to make this module usable outside wide 25 // our master define to make this module usable outside wine 26 27 27 #define OUTOFWINE 28 28 … … 30 30 #include "keyboard_outofwine.h" 31 31 int use_xkb = 1; 32 #endif 32 #endif // OUTOFWINE defined 33 33 34 34 #ifndef OUTOFWINE 35 35 #include "config.h" 36 #endif 36 #endif // OUTOFWINE not defined 37 37 38 38 #include <X11/Xatom.h> … … 41 41 #include <X11/Xresource.h> 42 42 #include <X11/Xutil.h> 43 #ifdef HAVE_X KB43 #ifdef HAVE_X11_XKBLIB_H 44 44 #include <X11/XKBlib.h> 45 45 #endif … … 60 60 #include "win.h" 61 61 #include "x11drv.h" 62 #include "wine/server.h" 62 63 #include "wine/unicode.h" 63 64 #include "wine/debug.h" … … 65 66 WINE_DEFAULT_DEBUG_CHANNEL(keyboard); 66 67 WINE_DECLARE_DEBUG_CHANNEL(key); 67 WINE_DECLARE_DEBUG_CHANNEL(dinput); 68 #endif // OUTOFWINE 68 #endif // OUTOFWINE not defined 69 70 typedef union 71 { 72 struct 73 { 74 #ifndef BITFIELDS_BIGENDIAN 75 unsigned long count : 16; 76 #endif 77 unsigned long code : 8; 78 unsigned long extended : 1; 79 unsigned long unused : 2; 80 unsigned long win_internal : 2; 81 unsigned long context : 1; 82 unsigned long previous : 1; 83 unsigned long transition : 1; 84 #ifdef BITFIELDS_BIGENDIAN 85 unsigned long count : 16; 86 #endif 87 } lp1; 88 unsigned long lp2; 89 } KEYLP; 90 91 /* key state table bits: 92 0x80 -> key is pressed 93 0x40 -> key got pressed since last time 94 0x01 -> key is toggled 95 */ 96 BYTE key_state_table[256]; 97 98 static BYTE TrackSysKey = 0; /* determine whether ALT key up will cause a WM_SYSKEYUP 99 or a WM_KEYUP message */ 69 100 70 101 static int min_keycode, max_keycode, keysyms_per_keycode; 71 102 static WORD keyc2vkey[256], keyc2scan[256]; 72 103 73 static LPBYTE pKeyStateTable;74 104 static int NumLockMask, AltGrMask; /* mask in the XKeyEvent state */ 75 105 static int kcControl, kcAlt, kcShift, kcNumLock, kcCapsLock; /* keycodes */ … … 139 169 }; 140 170 171 static const WORD main_key_scan_qwerty_jp106[MAIN_LEN] = 172 { 173 /* this is my (106-key) keyboard layout, sorry if it doesn't quite match yours */ 174 /* 1 2 3 4 5 6 7 8 9 0 - ^ \ */ 175 0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x29, 176 /* q w e r t y u i o p @ [ */ 177 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B, 178 /* a s d f g h j k l ; : ] */ 179 0x1E,0x1F,0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x2B, 180 /* z x c v b n m , . / */ 181 0x2C,0x2D,0x2E,0x2F,0x30,0x31,0x32,0x33,0x34,0x35, 182 0x56 /* the 102nd key (actually to the right of l-shift) */ 183 }; 184 185 141 186 static const WORD main_key_vkey_qwerty[MAIN_LEN] = 142 187 { 143 188 /* NOTE: this layout must concur with the scan codes layout above */ 144 VK_OEM_3, VK_1,VK_2,VK_3,VK_4,VK_5,VK_6,VK_7,VK_8,VK_9,VK_0,VK_OEM_MINUS,VK_OEM_PLUS,145 VK_Q,VK_W,VK_E,VK_R,VK_T,VK_Y,VK_U,VK_I,VK_O,VK_P,VK_OEM_4,VK_OEM_6,146 VK_A,VK_S,VK_D,VK_F,VK_G,VK_H,VK_J,VK_K,VK_L,VK_OEM_1,VK_OEM_7,VK_OEM_5,147 VK_Z,VK_X,VK_C,VK_V,VK_B,VK_N,VK_M,VK_OEM_COMMA,VK_OEM_PERIOD,VK_OEM_2,189 VK_OEM_3,'1','2','3','4','5','6','7','8','9','0',VK_OEM_MINUS,VK_OEM_PLUS, 190 'Q','W','E','R','T','Y','U','I','O','P',VK_OEM_4,VK_OEM_6, 191 'A','S','D','F','G','H','J','K','L',VK_OEM_1,VK_OEM_7,VK_OEM_5, 192 'Z','X','C','V','B','N','M',VK_OEM_COMMA,VK_OEM_PERIOD,VK_OEM_2, 148 193 VK_OEM_102 /* the 102nd key (actually to the right of l-shift) */ 149 194 }; 150 195 196 static const WORD main_key_vkey_qwerty_jp106[MAIN_LEN] = 197 { 198 /* NOTE: this layout must concur with the scan codes layout above */ 199 '1','2','3','4','5','6','7','8','9','0',VK_OEM_MINUS,VK_OEM_PLUS,VK_OEM_3, 200 'Q','W','E','R','T','Y','U','I','O','P',VK_OEM_4,VK_OEM_6, 201 'A','S','D','F','G','H','J','K','L',VK_OEM_1,VK_OEM_7,VK_OEM_5, 202 'Z','X','C','V','B','N','M',VK_OEM_COMMA,VK_OEM_PERIOD,VK_OEM_2, 203 VK_OEM_102 /* the 102nd key (actually to the right of l-shift) */ 204 }; 205 151 206 static const WORD main_key_vkey_qwerty_v2[MAIN_LEN] = 152 207 { 153 208 /* NOTE: this layout must concur with the scan codes layout above */ 154 VK_OEM_5, VK_1,VK_2,VK_3,VK_4,VK_5,VK_6,VK_7,VK_8,VK_9,VK_0,VK_OEM_PLUS,VK_OEM_4,155 VK_Q,VK_W,VK_E,VK_R,VK_T,VK_Y,VK_U,VK_I,VK_O,VK_P,VK_OEM_6,VK_OEM_1,156 VK_A,VK_S,VK_D,VK_F,VK_G,VK_H,VK_J,VK_K,VK_L,VK_OEM_3,VK_OEM_7,VK_OEM_2,157 VK_Z,VK_X,VK_C,VK_V,VK_B,VK_N,VK_M,VK_OEM_COMMA,VK_OEM_PERIOD,VK_OEM_MINUS,209 VK_OEM_5,'1','2','3','4','5','6','7','8','9','0',VK_OEM_PLUS,VK_OEM_4, 210 'Q','W','E','R','T','Y','U','I','O','P',VK_OEM_6,VK_OEM_1, 211 'A','S','D','F','G','H','J','K','L',VK_OEM_3,VK_OEM_7,VK_OEM_2, 212 'Z','X','C','V','B','N','M',VK_OEM_COMMA,VK_OEM_PERIOD,VK_OEM_MINUS, 158 213 VK_OEM_102 /* the 102nd key (actually to the right of l-shift) */ 159 214 }; … … 162 217 { 163 218 /* NOTE: this layout must concur with the scan codes layout above */ 164 VK_OEM_3, VK_1,VK_2,VK_3,VK_4,VK_5,VK_6,VK_7,VK_8,VK_9,VK_0,VK_OEM_MINUS,VK_OEM_PLUS,165 VK_Q,VK_W,VK_E,VK_R,VK_T,VK_Z,VK_U,VK_I,VK_O,VK_P,VK_OEM_4,VK_OEM_6,166 VK_A,VK_S,VK_D,VK_F,VK_G,VK_H,VK_J,VK_K,VK_L,VK_OEM_1,VK_OEM_7,VK_OEM_5,167 VK_Y,VK_X,VK_C,VK_V,VK_B,VK_N,VK_M,VK_OEM_COMMA,VK_OEM_PERIOD,VK_OEM_2,219 VK_OEM_3,'1','2','3','4','5','6','7','8','9','0',VK_OEM_MINUS,VK_OEM_PLUS, 220 'Q','W','E','R','T','Z','U','I','O','P',VK_OEM_4,VK_OEM_6, 221 'A','S','D','F','G','H','J','K','L',VK_OEM_1,VK_OEM_7,VK_OEM_5, 222 'Y','X','C','V','B','N','M',VK_OEM_COMMA,VK_OEM_PERIOD,VK_OEM_2, 168 223 VK_OEM_102 /* the 102nd key (actually to the right of l-shift) */ 169 224 }; … … 172 227 { 173 228 /* NOTE: this layout must concur with the scan codes layout above */ 174 VK_OEM_3, VK_1,VK_2,VK_3,VK_4,VK_5,VK_6,VK_7,VK_8,VK_9,VK_0,VK_OEM_MINUS,VK_OEM_PLUS,175 VK_Q,VK_W,VK_E,VK_R,VK_T,VK_Z,VK_U,VK_I,VK_O,VK_P,VK_OEM_4,VK_OEM_6,176 VK_A,VK_S,VK_D,VK_F,VK_G,VK_H,VK_J,VK_K,VK_L,VK_OEM_1,VK_OEM_7,VK_OEM_5,177 VK_OEM_102, VK_Y,VK_X,VK_C,VK_V,VK_B,VK_N,VK_M,VK_OEM_COMMA,VK_OEM_PERIOD,VK_OEM_2229 VK_OEM_3,'1','2','3','4','5','6','7','8','9','0',VK_OEM_MINUS,VK_OEM_PLUS, 230 'Q','W','E','R','T','Z','U','I','O','P',VK_OEM_4,VK_OEM_6, 231 'A','S','D','F','G','H','J','K','L',VK_OEM_1,VK_OEM_7,VK_OEM_5, 232 VK_OEM_102,'Y','X','C','V','B','N','M',VK_OEM_COMMA,VK_OEM_PERIOD,VK_OEM_2 178 233 }; 179 234 … … 181 236 { 182 237 /* NOTE: this layout must concur with the scan codes layout above */ 183 VK_OEM_3, VK_1,VK_2,VK_3,VK_4,VK_5,VK_6,VK_7,VK_8,VK_9,VK_0,VK_OEM_MINUS,VK_OEM_PLUS,184 VK_Q,VK_W,VK_E,VK_R,VK_T,VK_Y,VK_U,VK_I,VK_O,VK_P,VK_OEM_4,VK_OEM_6,185 VK_A,VK_S,VK_D,VK_F,VK_G,VK_H,VK_J,VK_K,VK_L,VK_OEM_1,VK_OEM_8,VK_OEM_5,186 VK_OEM_7, VK_Z,VK_X,VK_C,VK_V,VK_B,VK_N,VK_M,VK_OEM_COMMA,VK_OEM_PERIOD,VK_OEM_2,238 VK_OEM_3,'1','2','3','4','5','6','7','8','9','0',VK_OEM_MINUS,VK_OEM_PLUS, 239 'Q','W','E','R','T','Y','U','I','O','P',VK_OEM_4,VK_OEM_6, 240 'A','S','D','F','G','H','J','K','L',VK_OEM_1,VK_OEM_8,VK_OEM_5, 241 VK_OEM_7,'Z','X','C','V','B','N','M',VK_OEM_COMMA,VK_OEM_PERIOD,VK_OEM_2, 187 242 VK_OEM_102, /* the 102nd key (actually to the right of l-shift) */ 188 243 }; … … 191 246 { 192 247 /* NOTE: this layout must concur with the scan codes layout above */ 193 VK_OEM_7, VK_1,VK_2,VK_3,VK_4,VK_5,VK_6,VK_7,VK_8,VK_9,VK_0,VK_OEM_4,VK_OEM_PLUS,194 VK_A,VK_Z,VK_E,VK_R,VK_T,VK_Y,VK_U,VK_I,VK_O,VK_P,VK_OEM_6,VK_OEM_1,195 VK_Q,VK_S,VK_D,VK_F,VK_G,VK_H,VK_J,VK_K,VK_L,VK_M,VK_OEM_3,VK_OEM_5,196 VK_W,VK_X,VK_C,VK_V,VK_B,VK_N,VK_OEM_COMMA,VK_OEM_PERIOD,VK_OEM_2,VK_OEM_8,248 VK_OEM_7,'1','2','3','4','5','6','7','8','9','0',VK_OEM_4,VK_OEM_PLUS, 249 'A','Z','E','R','T','Y','U','I','O','P',VK_OEM_6,VK_OEM_1, 250 'Q','S','D','F','G','H','J','K','L','M',VK_OEM_3,VK_OEM_5, 251 'W','X','C','V','B','N',VK_OEM_COMMA,VK_OEM_PERIOD,VK_OEM_2,VK_OEM_8, 197 252 VK_OEM_102 /* the 102nd key (actually to the right of l-shift) */ 198 253 }; … … 201 256 { 202 257 /* NOTE: this layout must concur with the scan codes layout above */ 203 VK_OEM_3, VK_1,VK_2,VK_3,VK_4,VK_5,VK_6,VK_7,VK_8,VK_9,VK_0,VK_OEM_4,VK_OEM_6,204 VK_OEM_7,VK_OEM_COMMA,VK_OEM_PERIOD, VK_P,VK_Y,VK_F,VK_G,VK_C,VK_R,VK_L,VK_OEM_2,VK_OEM_PLUS,205 VK_A,VK_O,VK_E,VK_U,VK_I,VK_D,VK_H,VK_T,VK_N,VK_S,VK_OEM_MINUS,VK_OEM_5,206 VK_OEM_1, VK_Q,VK_J,VK_K,VK_X,VK_B,VK_M,VK_W,VK_V,VK_Z,258 VK_OEM_3,'1','2','3','4','5','6','7','8','9','0',VK_OEM_4,VK_OEM_6, 259 VK_OEM_7,VK_OEM_COMMA,VK_OEM_PERIOD,'P','Y','F','G','C','R','L',VK_OEM_2,VK_OEM_PLUS, 260 'A','O','E','U','I','D','H','T','N','S',VK_OEM_MINUS,VK_OEM_5, 261 VK_OEM_1,'Q','J','K','X','B','M','W','V','Z', 207 262 VK_OEM_102 /* the 102nd key (actually to the right of l-shift) */ 208 263 }; … … 270 325 }; 271 326 272 /*** French keyboard layout ( contributed by Eric Pouech) */327 /*** French keyboard layout (setxkbmap fr) */ 273 328 static const char main_key_FR[MAIN_LEN][4] = 274 329 { 275 "²","&1","é2 ~","\"3#","'4{","(5[","-6|","è7`","_8\\","ç9^±","à0@",")°]","=+}",276 "aA","zZ","eE ¿","rR","tT","yY","uU","iI","oO","pP","^¨","$£¤",277 "qQ","sS ß","dD","fF","gG","hH","jJ","kK","lL","mM","ù%","*µ",330 "²","&1","é2","\"3","'4","(5","-6","è7","_8","ç9","à0",")°","=+", 331 "aA","zZ","eE","rR","tT","yY","uU","iI","oO","pP","^¨","$£", 332 "qQ","sS","dD","fF","gG","hH","jJ","kK","lL","mM","ù%","*µ", 278 333 "wW","xX","cC","vV","bB","nN",",?",";.",":/","!§", 279 334 "<>" … … 290 345 }; 291 346 292 /*** German keyboard layout ( contributed by Ulrich Weigand) */347 /*** German keyboard layout (setxkbmap de) */ 293 348 static const char main_key_DE[MAIN_LEN][4] = 294 349 { 295 "^°","1!","2\" ²","3§³","4$","5%","6&","7/{","8([","9)]","0=}","ß?\\","'`",296 "qQ @","wW","eE","rR","tT","zZ","uU","iI","oO","pP","üÜ","+*~",297 "aA","sS","dD","fF","gG","hH","jJ","kK","lL","öÖ","äÄ","# ´",298 "yY","xX","cC","vV","bB","nN","mM µ",",;",".:","-_",350 "^°","1!","2\"","3§","4$","5%","6&","7/","8(","9)","0=","ß?","´`", 351 "qQ","wW","eE","rR","tT","zZ","uU","iI","oO","pP","üÜ","+*", 352 "aA","sS","dD","fF","gG","hH","jJ","kK","lL","öÖ","äÄ","#'", 353 "yY","xX","cC","vV","bB","nN","mM",",;",".:","-_", 299 354 "<>|" 300 355 }; … … 319 374 }; 320 375 321 /*** Swiss German keyboard layout ( contributed by Jonathan Naylor) */376 /*** Swiss German keyboard layout (setxkbmap ch -variant de) */ 322 377 static const char main_key_SG[MAIN_LEN][4] = 323 378 { 324 "§°","1+ |","2\"@","3*#","4ç","5%","6&¬","7/¦","8(¢","9)","0=","'?´","^`~",325 "qQ","wW","eE","rR","tT","zZ","uU","iI","oO","pP","üè [","¨!]",326 "aA","sS","dD","fF","gG","hH","jJ","kK","lL","öé","äà {","$£}",379 "§°","1+","2\"","3*","4ç","5%","6&","7/","8(","9)","0=","'?","^`", 380 "qQ","wW","eE","rR","tT","zZ","uU","iI","oO","pP","üè","¨!", 381 "aA","sS","dD","fF","gG","hH","jJ","kK","lL","öé","äà","$£", 327 382 "yY","xX","cC","vV","bB","nN","mM",",;",".:","-_", 328 "<> \\"329 }; 330 331 /*** Swiss French keyboard layout ( contributed by Philippe Froidevaux) */383 "<>" 384 }; 385 386 /*** Swiss French keyboard layout (setxkbmap ch -variant fr) */ 332 387 static const char main_key_SF[MAIN_LEN][4] = 333 388 { 334 "§°","1+ |","2\"@","3*#","4ç","5%","6&¬","7/¦","8(¢","9)","0=","'?´","^`~",335 "qQ","wW","eE","rR","tT","zZ","uU","iI","oO","pP","èü [","¨!]",336 "aA","sS","dD","fF","gG","hH","jJ","kK","lL","éö","àä {","$£}",389 "§°","1+","2\"","3*","4ç","5%","6&","7/","8(","9)","0=","'?","^`", 390 "qQ","wW","eE","rR","tT","zZ","uU","iI","oO","pP","èü","¨!", 391 "aA","sS","dD","fF","gG","hH","jJ","kK","lL","éö","àä","$£", 337 392 "yY","xX","cC","vV","bB","nN","mM",",;",".:","-_", 338 "<> \\"393 "<>" 339 394 }; 340 395 … … 369 424 }; 370 425 371 /*** Estonian keyboard layout ( contributed by Raul Metsma zombi82@hot.ee) */426 /*** Estonian keyboard layout (setxkbmap ee) */ 372 427 static const char main_key_ET[MAIN_LEN][4] = 373 428 { 374 "·~","1!","2\" @","3#£","4¤$","5%","6&","7/{","8([","9)]","0=}","+?\\","´`",375 "qQ","wW","eE","rR","tT","yY","uU","iI","oO","pP","üÜ","õÕ §",376 "aA","sS","dD","fF","gG","hH","jJ","kK","lL","öÖ","äÄ","'* ½",429 "·~","1!","2\"","3#","4¤","5%","6&","7/","8(","9)","0=","+?","´`", 430 "qQ","wW","eE","rR","tT","yY","uU","iI","oO","pP","üÜ","õÕ", 431 "aA","sS","dD","fF","gG","hH","jJ","kK","lL","öÖ","äÄ","'*", 377 432 "zZ","xX","cC","vV","bB","nN","mM",",;",".:","-_", 378 "<> |"379 }; 380 381 /*** Canadian French keyboard layout */433 "<>" 434 }; 435 436 /*** Canadian French keyboard layout (setxkbmap ca_enhanced) */ 382 437 static const char main_key_CF[MAIN_LEN][4] = 383 438 { … … 389 444 }; 390 445 446 /*** Canadian French keyboard layout (setxkbmap ca -variant fr) */ 447 static const char main_key_CA_fr[MAIN_LEN][4] = 448 { 449 "#|","1!","2\"","3/","4$","5%","6?","7&","8*","9(","0)","-_","=+", 450 "qQ","wW","eE","rR","tT","yY","uU","iI","oO","pP","^^","¸¨", 451 "aA","sS","dD","fF","gG","hH","jJ","kK","lL",";:","``","<>", 452 "zZ","xX","cC","vV","bB","nN","mM",",'",".","éÉ", 453 "«»" 454 }; 455 456 /*** Canadian keyboard layout (setxkbmap ca) */ 457 static const char main_key_CA[MAIN_LEN][4] = 458 { 459 "/\\","1!¹¡","2@²","3#³£","4$¼¤","5%½","6?¾","7&","8*","9(","0)","-_","=+", 460 "qQ","wW","eE","rR","tT","yY","uU","iI","oOøØ","pPþÞ","^¨¨","çÇ~", 461 "aAæÆ","sSߧ","dDðÐ","fF","gG","hH","jJ","kK","lL",";:´","èÈ","àÀ", 462 "zZ","xX","cC¢©","vV","bB","nN","mMµº",",'",".\"·÷","éÉ", 463 "ùÙ" 464 }; 465 391 466 /*** Portuguese keyboard layout (setxkbmap pt) */ 392 467 static const char main_key_PT[MAIN_LEN][4] = … … 509 584 }; 510 585 586 /*** Ukrainian keyboard layout KOI8-U by O. Nykyforchyn */ 587 /*** (as it appears on most of keyboards sold today) */ 588 static const char main_key_UA_std[MAIN_LEN][4] = 589 { 590 "½","1!","2\"","3'","4;","5%","6:","7?","8*","9(","0)","-_","=+", 591 "Êê","Ãã","Õõ","Ëë","Åå","Îî","Çç","Ûû","Ýý","Úú","Èè","§·", 592 "Ææ","¦¶","×÷","Áá","Ðð","Òò","Ïï","Ìì","Ää","Öö","¤´","\\/", 593 "Ññ","Þþ","Óó","Íí","Éé","Ôô","Øø","Ââ","Àà",".,", 594 "<>" /* the phantom key */ 595 }; 596 597 /*** Russian keyboard layout KOI8-R (pair to the previous) */ 598 static const char main_key_RU_std[MAIN_LEN][4] = 599 { 600 "£³","1!","2\"","3'","4;","5%","6:","7?","8*","9(","0)","-_","=+", 601 "Êê","Ãã","Õõ","Ëë","Åå","Îî","Çç","Ûû","Ýý","Úú","Èè","ßÿ", 602 "Ææ","Ùù","×÷","Áá","Ðð","Òò","Ïï","Ìì","Ää","Öö","Üü","\\/", 603 "Ññ","Þþ","Óó","Íí","Éé","Ôô","Øø","Ââ","Àà",".,", 604 "<>" /* the phantom key */ 605 }; 606 511 607 /*** Spanish keyboard layout (setxkbmap es) */ 512 608 static const char main_key_ES[MAIN_LEN][4] = … … 529 625 }; 530 626 531 /*** Hungarian keyboard layout ( contributed by Zoltán Kovács) */627 /*** Hungarian keyboard layout (setxkbmap hu) */ 532 628 static const char main_key_HU[MAIN_LEN][4] = 533 629 { 534 "0§","1' ~","2\"·","3+^","4!¢","5%°","6/²","7=`","8(ÿ","9)´","öÖ½","üܨ","óÓ¸",535 "qQ \\","wW|","eE","rR","tT","zZ","uU","iIÍ","oOø","pP","õÕ÷","úÚ×",536 "aA","sS ð","dDÐ","fF[","gG]","hH","jJí","kK³","lL£","éÉ$","áÁß","ûÛ¤",537 "yY >","xX#","cC&","vV@","bB{","nN}","mM",",?;",".:>","-_*",538 "íÍ <"630 "0§","1'","2\"","3+","4!","5%","6/","7=","8(","9)","öÖ","üÜ","óÓ", 631 "qQ","wW","eE","rR","tT","zZ","uU","iI","oO","pP","õÕ","úÚ", 632 "aA","sS","dD","fF","gG","hH","jJ","kK","lL","éÉ","áÁ","ûÛ", 633 "yY","xX","cC","vV","bB","nN","mM",",?",".:","-_", 634 "íÍ" 539 635 }; 540 636 … … 559 655 }; 560 656 657 /*** Serbian keyboard layout (setxkbmap sr) ***/ 658 static const char main_key_SR[MAIN_LEN][4] = 659 { 660 "`~","1!","2\"","3#","4$","5%","6&","7/","8(","9)","0=","'?","+*", 661 "©¹","ªº","Åå","Òò","Ôô","Úú","Õõ","Éé","Ïï","Ðð","Ûû","[]", 662 "Áá","Óó","Ää","Ææ","Çç","Èè","¨¸","Ëë","Ìì","Þþ","«»","-_", 663 "¡±","¯¿","Ãã","×÷","Ââ","Îî","Íí",",;",".:","Öö", 664 "<>" /* the phantom key */ 665 }; 666 667 /*** Serbian keyboard layout (setxkbmap us,sr) ***/ 668 static const char main_key_US_SR[MAIN_LEN][4] = 669 { 670 "`~","1!","2@2\"","3#","4$","5%","6^6&","7&7/","8*8(","9(9)","0)0=","-_'?","=++*", 671 "qQ©¹","wWªº","eEÅå","rRÒò","tTÔô","yYÚú","uUÕõ","iIÉé","oOÏï","pPÐð","[{Ûû","]}[]", 672 "aAÁá","sSÓó","dDÄä","fFÆæ","gGÇç","hHÈè","jJ¨¸","kKËë","lLÌì",";:Þþ","'\"«»","\\|-_", 673 "zZ¡±","xX¯¿","cCÃã","vV×÷","bBÂâ","nNÎî","mMÍí",",<,;",".>.:","/?Öö", 674 "<>" /* the phantom key */ 675 }; 676 561 677 /*** Croatian keyboard layout specific for me <[email protected]> ***/ 562 678 static const char main_key_HR_jelly[MAIN_LEN][4] = … … 605 721 "qQ","wW","eE","rR","tT","yY","uU","iI","oO","pP","´`","[{", 606 722 "aA","sS","dD","fF","gG","hH","jJ","kK","lL","çÇ","~^","]}", 607 "zZ","xX","cC","vV","bB","nN","mM",",<",".>",";:","/?", 608 "\\|" 723 "\\|","zZ","xX","cC","vV","bB","nN","mM",",<",".>",";:","/?", 609 724 }; 610 725 … … 615 730 "qQ","wW","eE","rR","tT","yY","uU","iI","oO","pP","4`","[{*", 616 731 "aA","sS","dD","fF","gG","hH","jJ","kK","lL","gG","~^","]}:", 617 "zZ","xX","cC","vV","bB","nN","mM",",<",".>",";:","/?0", 618 "\\|" 732 "\\|","zZ","xX","cC","vV","bB","nN","mM",",<",".>",";:","/?0" 619 733 }; 620 734 … … 630 744 /*** Slovak keyboard layout (see cssk_ibm(sk_qwerty) in xkbsel) 631 745 - dead_abovering replaced with degree - no symbol in iso8859-2 632 - brokenbar replaced with bar 746 - brokenbar replaced with bar */ 633 747 static const char main_key_SK[MAIN_LEN][4] = 634 748 { … … 690 804 }; 691 805 692 /*** Lithuanian (Baltic) keyboard layout (pc/lt in XFree86 4.3.0, contributed by Nerijus Baliûnas) */806 /*** Lithuanian keyboard layout (setxkbmap lt) */ 693 807 static const char main_key_LT_B[MAIN_LEN][4] = 694 808 { … … 696 810 "qQ","wW","eE","rR","tT","yY","uU","iI","oO","pP","[{","]}", 697 811 "aA","sS","dD","fF","gG","hH","jJ","kK","lL",";:","'\"", 698 "zZ","xX","cC","vV","bB","nN","mM",",<",".>","/?" 812 "zZ","xX","cC","vV","bB","nN","mM",",<",".>","/?", 813 "ª¬" 699 814 }; 700 815 … … 706 821 "aAæ","sSß","dD","fF","gG","hH","jJ","kK","lL","þÞ","iÝ",",;`", 707 822 "zZ","xX","cC","vV","bB","nN","mM","öÖ","çÇ",".:" 823 }; 824 825 /*** Turkish keyboard layout (setxkbmap tr) */ 826 static const char main_key_TR[MAIN_LEN][4] = 827 { 828 "\"\\","1!","2'","3^","4+","5%","6&","7/","8(","9)","0=","*?","-_", 829 "qQ","wW","eE","rR","tT","yY","uU","\xb9I","oO","pP","\xbb\xab","üÜ", 830 "aA","sS","dD","fF","gG","hH","jJ","kK","lL","\xba\xaa","i\0",",;", 831 "zZ","xX","cC","vV","bB","nN","mM","öÖ","çÇ",".:", 832 "<>" 833 }; 834 835 /*** Turkish F keyboard layout (setxkbmap trf) */ 836 static const char main_key_TR_F[MAIN_LEN][4] = 837 { 838 "+*","1!","2\"","3^#","4$","5%","6&","7'","8(","9)","0=","/?","-_", 839 "fF","gG","\xbb\xab","\xb9I","oO","dD","rR","nN","hH","pP","qQ","wW", 840 "uU","i\0","eE","aA","üÜ","tT","kK","mM","lL","yY","\xba\xaa","xX", 841 "jJ","öÖ","vV","cC","çÇ","zZ","sS","bB",".:",",;", 842 "<>" 708 843 }; 709 844 … … 757 892 "aA¿Ä","sS˦","dD¡¯","fF´â","gGà¬","hHéç","jJèë","kKÒÉ","lLÊÈ",";:Ç«","\'\"§.","\\|£¥", 758 893 "zZ¼(","xX»)","cCá©","vVÍÎ","bBÚ","nN×ì","mM·?",",<Á²",".>ãÌ","/?½Æ" 759 }; 894 }; 760 895 761 896 /*** VNC keyboard layout */ … … 769 904 static const WORD main_key_vkey_vnc[MAIN_LEN] = 770 905 { 771 VK_1,VK_2,VK_3,VK_4,VK_5,VK_6,VK_7,VK_8,VK_9,VK_0,VK_OEM_MINUS,VK_OEM_PLUS,VK_OEM_4,VK_OEM_6,VK_OEM_1,VK_OEM_7,VK_OEM_3,VK_OEM_COMMA,VK_OEM_PERIOD,VK_OEM_2,VK_OEM_5,772 VK_A,VK_B,VK_C,VK_D,VK_E,VK_F,VK_G,VK_H,VK_I,VK_J,VK_K,VK_L,VK_M,VK_N,VK_O,VK_P,VK_Q,VK_R,VK_S,VK_T,VK_U,VK_V,VK_W,VK_X,VK_Y,VK_Z,906 '1','2','3','4','5','6','7','8','9','0',VK_OEM_MINUS,VK_OEM_PLUS,VK_OEM_4,VK_OEM_6,VK_OEM_1,VK_OEM_7,VK_OEM_3,VK_OEM_COMMA,VK_OEM_PERIOD,VK_OEM_2,VK_OEM_5, 907 'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z', 773 908 VK_OEM_102 774 909 }; … … 818 953 {0x040c, "French keyboard layout", &main_key_FR, &main_key_scan_qwerty, &main_key_vkey_azerty}, 819 954 {0x0c0c, "Canadian French keyboard layout", &main_key_CF, &main_key_scan_qwerty, &main_key_vkey_qwerty}, 955 {0x0c0c, "Canadian French keyboard layout (CA_fr)", &main_key_CA_fr, &main_key_scan_qwerty, &main_key_vkey_qwerty}, 956 {0x0c0c, "Canadian keyboard layout", &main_key_CA, &main_key_scan_qwerty, &main_key_vkey_qwerty}, 820 957 {0x080c, "Belgian keyboard layout", &main_key_BE, &main_key_scan_qwerty, &main_key_vkey_azerty}, 821 958 {0x0816, "Portuguese keyboard layout", &main_key_PT, &main_key_scan_qwerty, &main_key_vkey_qwerty}, … … 832 969 {0x0419, "Russian phonetic keyboard layout", &main_key_RU_phonetic, &main_key_scan_qwerty, &main_key_vkey_qwerty}, 833 970 {0x0422, "Ukrainian keyboard layout KOI8-U", &main_key_UA, &main_key_scan_qwerty, &main_key_vkey_qwerty}, 971 {0x0422, "Ukrainian keyboard layout (standard)", &main_key_UA_std, &main_key_scan_qwerty, &main_key_vkey_qwerty}, 972 {0x0419, "Russian keyboard layout (standard)", &main_key_RU_std, &main_key_scan_qwerty, &main_key_vkey_qwerty}, 834 973 {0x040a, "Spanish keyboard layout", &main_key_ES, &main_key_scan_qwerty, &main_key_vkey_qwerty}, 835 974 {0x0410, "Italian keyboard layout", &main_key_IT, &main_key_scan_qwerty, &main_key_vkey_qwerty}, … … 838 977 {0x0415, "Polish (programmer's) keyboard layout", &main_key_PL, &main_key_scan_qwerty, &main_key_vkey_qwerty}, 839 978 {0x0424, "Slovenian keyboard layout", &main_key_SI, &main_key_scan_qwerty, &main_key_vkey_qwertz}, 979 {0x0c1a, "Serbian keyboard layout sr", &main_key_SR, &main_key_scan_qwerty, &main_key_vkey_qwerty}, /* LANG_SERBIAN,SUBLANG_SERBIAN_CYRILLIC */ 980 {0x0c1a, "Serbian keyboard layout us,sr", &main_key_US_SR, &main_key_scan_qwerty, &main_key_vkey_qwerty}, /* LANG_SERBIAN,SUBLANG_SERBIAN_CYRILLIC */ 840 981 {0x041a, "Croatian keyboard layout", &main_key_HR, &main_key_scan_qwerty, &main_key_vkey_qwertz}, 841 982 {0x041a, "Croatian keyboard layout (specific)", &main_key_HR_jelly, &main_key_scan_qwerty, &main_key_vkey_qwerty}, 842 {0x e0010411, "Japanese 106 keyboard layout", &main_key_JA_jp106, &main_key_scan_qwerty, &main_key_vkey_qwerty},843 {0x e0010411, "Japanese pc98x1 keyboard layout", &main_key_JA_pc98x1, &main_key_scan_qwerty, &main_key_vkey_qwerty},983 {0x0411, "Japanese 106 keyboard layout", &main_key_JA_jp106, &main_key_scan_qwerty_jp106, &main_key_vkey_qwerty_jp106}, 984 {0x0411, "Japanese pc98x1 keyboard layout", &main_key_JA_pc98x1, &main_key_scan_qwerty, &main_key_vkey_qwerty}, 844 985 {0x041b, "Slovak keyboard layout", &main_key_SK, &main_key_scan_qwerty, &main_key_vkey_qwerty}, 845 986 {0x041b, "Slovak and Czech keyboard layout without dead keys", &main_key_SK_prog, &main_key_scan_qwerty, &main_key_vkey_qwerty}, … … 850 991 {0x0427, "Lithuanian (Baltic) keyboard layout", &main_key_LT_B, &main_key_scan_qwerty, &main_key_vkey_qwerty}, 851 992 {0x041f, "Turkish keyboard layout", &main_key_TK, &main_key_scan_qwerty, &main_key_vkey_qwerty}, 993 {0x041f, "Turkish keyboard layout tr", &main_key_TR, &main_key_scan_qwerty, &main_key_vkey_qwerty}, 994 {0x041f, "Turkish keyboard layout trf", &main_key_TR_F, &main_key_scan_qwerty, &main_key_vkey_qwerty}, 852 995 {0x040d, "Israelian keyboard layout", &main_key_IL, &main_key_scan_qwerty, &main_key_vkey_qwerty}, 853 996 {0x040d, "Israelian phonetic keyboard layout", &main_key_IL_phonetic, &main_key_scan_qwerty, &main_key_vkey_qwerty}, … … 891 1034 0, 0, 0, 0, 0, 0, 0, 0, /* FF58 */ 892 1035 /* misc keys */ 893 VK_SELECT, VK_SNAPSHOT, VK_EXECUTE, VK_INSERT, 0, 0, 0, /* FF60 */ 894 VK_APPS, 895 VK_CANCEL, VK_HELP, VK_CANCEL, VK_CANCEL, 0, 0, 0, 0, /* FF68 */ 1036 VK_SELECT, VK_SNAPSHOT, VK_EXECUTE, VK_INSERT, 0,0,0, VK_APPS, /* FF60 */ 1037 0, VK_CANCEL, VK_HELP, VK_CANCEL, 0, 0, 0, 0, /* FF68 */ 896 1038 0, 0, 0, 0, 0, 0, 0, 0, /* FF70 */ 897 1039 /* keypad keys */ … … 901 1043 0, 0, 0, 0, 0, VK_HOME, VK_LEFT, VK_UP, /* FF90 */ 902 1044 VK_RIGHT, VK_DOWN, VK_PRIOR, VK_NEXT, /* FF98 */ 903 VK_END, 0, VK_INSERT, VK_DELETE,1045 VK_END, VK_CLEAR, VK_INSERT, VK_DELETE, 904 1046 0, 0, 0, 0, 0, 0, 0, 0, /* FFA0 */ 905 1047 0, 0, VK_MULTIPLY, VK_ADD, /* FFA8 */ … … 907 1049 VK_NUMPAD0, VK_NUMPAD1, VK_NUMPAD2, VK_NUMPAD3, /* FFB0 */ 908 1050 VK_NUMPAD4, VK_NUMPAD5, VK_NUMPAD6, VK_NUMPAD7, 909 VK_NUMPAD8, VK_NUMPAD9, 0, 0, 0, 0,/* FFB8 */1051 VK_NUMPAD8, VK_NUMPAD9, 0, 0, 0, VK_OEM_NEC_EQUAL, /* FFB8 */ 910 1052 /* function keys */ 911 1053 VK_F1, VK_F2, 912 1054 VK_F3, VK_F4, VK_F5, VK_F6, VK_F7, VK_F8, VK_F9, VK_F10, /* FFC0 */ 913 VK_F11, VK_F12, VK_LWIN /*VK_F13*/, VK_RWIN /*VK_F14*/, /* FFC8 */ 914 VK_F15, VK_F16, 0, 0, 1055 VK_F11, VK_F12, VK_F13, VK_F14, VK_F15, VK_F16, 0, 0, /* FFC8 */ 915 1056 0, 0, 0, 0, 0, 0, 0, 0, /* FFD0 */ 916 1057 0, 0, 0, 0, 0, 0, 0, 0, /* FFD8 */ … … 942 1083 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* FF58 */ 943 1084 /* misc keys */ 944 /*?*/ 0, 0x137, /*?*/ 0, 0x152, 0x00, 0x00, 0x00, 0x 15D,/* FF60 */1085 /*?*/ 0, 0x137, /*?*/ 0, 0x152, 0x00, 0x00, 0x00, 0x00, /* FF60 */ 945 1086 /*?*/ 0, /*?*/ 0, 0x38, 0x146, 0x00, 0x00, 0x00, 0x00, /* FF68 */ 946 1087 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* FF70 */ … … 952 1093 0x4D, 0x50, 0x49, 0x51, 0x4F, 0x4C, 0x52, 0x53, /* FF98 */ 953 1094 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* FFA0 */ 954 0x00, 0x00, 0x37, 0x4E, /*?*/ 0, 0x4A, 0x53, 0x135,/* FFA8 */1095 0x00, 0x00, 0x37, 0x4E, 0x53, 0x4A, 0x53, 0x135, /* FFA8 */ 955 1096 0x52, 0x4F, 0x50, 0x51, 0x4B, 0x4C, 0x4D, 0x47, /* FFB0 */ 956 1097 0x48, 0x49, 0x00, 0x00, 0x00, 0x00, /* FFB8 */ … … 958 1099 0x3B, 0x3C, 959 1100 0x3D, 0x3E, 0x3F, 0x40, 0x41, 0x42, 0x43, 0x44, /* FFC0 */ 960 0x57, 0x58, 0x 15B, 0x15C, 0x00, 0x00, 0x00, 0x00,/* FFC8 */1101 0x57, 0x58, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* FFC8 */ 961 1102 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* FFD0 */ 962 1103 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* FFD8 */ … … 968 1109 }; 969 1110 1111 static const WORD xfree86_vendor_key_vkey[256] = 1112 { 1113 0, 0, 0, 0, 0, 0, 0, 0, /* 1008FF00 */ 1114 0, 0, 0, 0, 0, 0, 0, 0, /* 1008FF08 */ 1115 0, VK_VOLUME_DOWN, VK_VOLUME_MUTE, VK_VOLUME_UP, /* 1008FF10 */ 1116 VK_MEDIA_PLAY_PAUSE, VK_MEDIA_STOP, 1117 VK_MEDIA_PREV_TRACK, VK_MEDIA_NEXT_TRACK, 1118 0, VK_LAUNCH_MAIL, 0, VK_BROWSER_SEARCH, /* 1008FF18 */ 1119 0, 0, 0, VK_BROWSER_HOME, 1120 0, 0, 0, 0, 0, 0, VK_BROWSER_BACK, VK_BROWSER_FORWARD, /* 1008FF20 */ 1121 VK_BROWSER_STOP, VK_BROWSER_REFRESH, 0, 0, 0, 0, 0, 0, /* 1008FF28 */ 1122 VK_BROWSER_FAVORITES, 0, VK_LAUNCH_MEDIA_SELECT, 0, /* 1008FF30 */ 1123 0, 0, 0, 0, 1124 0, 0, 0, 0, 0, 0, 0, 0, /* 1008FF38 */ 1125 0, 0, 0, 0, 0, 0, 0, 0, /* 1008FF40 */ 1126 0, 0, 0, 0, 0, 0, 0, 0, /* 1008FF48 */ 1127 0, 0, 0, 0, 0, 0, 0, 0, /* 1008FF50 */ 1128 0, 0, 0, 0, 0, 0, 0, 0, /* 1008FF58 */ 1129 0, 0, 0, 0, 0, 0, 0, 0, /* 1008FF60 */ 1130 0, 0, 0, 0, 0, 0, 0, 0, /* 1008FF68 */ 1131 0, 0, 0, 0, 0, 0, 0, 0, /* 1008FF70 */ 1132 0, 0, 0, 0, 0, 0, 0, 0, /* 1008FF78 */ 1133 0, 0, 0, 0, 0, 0, 0, 0, /* 1008FF80 */ 1134 0, 0, 0, 0, 0, 0, 0, 0, /* 1008FF88 */ 1135 0, 0, 0, 0, 0, 0, 0, 0, /* 1008FF90 */ 1136 0, 0, 0, 0, 0, 0, 0, 0, /* 1008FF98 */ 1137 0, 0, 0, 0, 0, 0, 0, 0, /* 1008FFA0 */ 1138 0, 0, 0, 0, 0, 0, 0, 0, /* 1008FFA8 */ 1139 0, 0, 0, 0, 0, 0, 0, 0, /* 1008FFB0 */ 1140 0, 0, 0, 0, 0, 0, 0, 0, /* 1008FFB8 */ 1141 0, 0, 0, 0, 0, 0, 0, 0, /* 1008FFC0 */ 1142 0, 0, 0, 0, 0, 0, 0, 0, /* 1008FFC8 */ 1143 0, 0, 0, 0, 0, 0, 0, 0, /* 1008FFD0 */ 1144 0, 0, 0, 0, 0, 0, 0, 0, /* 1008FFD8 */ 1145 0, 0, 0, 0, 0, 0, 0, 0, /* 1008FFE0 */ 1146 0, 0, 0, 0, 0, 0, 0, 0, /* 1008FFE8 */ 1147 0, 0, 0, 0, 0, 0, 0, 0, /* 1008FFF0 */ 1148 0, 0, 0, 0, 0, 0, 0, 0 /* 1008FFF8 */ 1149 }; 970 1150 971 1151 /* Returns the Windows virtual key code associated with the X event <e> */ … … 974 1154 { 975 1155 KeySym keysym = 0; 976 977 if (xic) 978 XmbLookupString(xic, e, NULL, 0, &keysym, NULL); 1156 Status status; 1157 char buf[24]; 1158 1159 /* Clients should pass only KeyPress events to XmbLookupString */ 1160 if (xic && e->type == KeyPress) 1161 XmbLookupString(xic, e, buf, sizeof(buf), &keysym, &status); 979 1162 else 980 XLookupString(e, NULL, 0, &keysym, NULL); 981 982 if ((keysym >= 0xFFAE) && (keysym <= 0xFFB9) && (keysym != 0xFFAF) 983 && (e->state & NumLockMask)) 1163 XLookupString(e, buf, sizeof(buf), &keysym, NULL); 1164 1165 if ((e->state & NumLockMask) && 1166 (keysym == XK_KP_Separator || keysym == XK_KP_Decimal || 1167 (keysym >= XK_KP_0 && keysym <= XK_KP_9))) 984 1168 /* Only the Keypad keys 0-9 and . send different keysyms 985 1169 * depending on the NumLock state */ … … 993 1177 static BOOL NumState=FALSE, CapsState=FALSE; 994 1178 1179 995 1180 /*********************************************************************** 996 * send_keyboard_input1181 * X11DRV_send_keyboard_input 997 1182 */ 998 static void send_keyboard_input( WORD wVk, WORD wScan, DWORD dwFlags, DWORD time ) 1183 void X11DRV_send_keyboard_input( WORD wVk, WORD wScan, DWORD dwFlags, DWORD time, 1184 DWORD dwExtraInfo, UINT injected_flags ) 999 1185 { 1000 1186 #ifndef OUTOFWINE 1001 INPUT input; 1002 1003 input.type = WINE_INTERNAL_INPUT_KEYBOARD; 1004 input.u.ki.wVk = wVk; 1005 input.u.ki.wScan = wScan; 1006 input.u.ki.dwFlags = dwFlags; 1007 input.u.ki.time = time; 1008 input.u.ki.dwExtraInfo = 0; 1009 SendInput( 1, &input, sizeof(input) ); 1010 #else 1187 UINT message; 1188 KEYLP keylp; 1189 KBDLLHOOKSTRUCT hook; 1190 WORD wVkStripped; 1191 1192 wVk = LOBYTE(wVk); 1193 1194 /* strip left/right for menu, control, shift */ 1195 if (wVk == VK_LMENU || wVk == VK_RMENU) 1196 wVkStripped = VK_MENU; 1197 else if (wVk == VK_LCONTROL || wVk == VK_RCONTROL) 1198 wVkStripped = VK_CONTROL; 1199 else if (wVk == VK_LSHIFT || wVk == VK_RSHIFT) 1200 wVkStripped = VK_SHIFT; 1201 else 1202 wVkStripped = wVk; 1203 1204 keylp.lp2 = 0; 1205 keylp.lp1.count = 1; 1206 keylp.lp1.code = wScan; 1207 keylp.lp1.extended = (dwFlags & KEYEVENTF_EXTENDEDKEY) != 0; 1208 keylp.lp1.win_internal = 0; /* this has something to do with dialogs, 1209 * don't remember where I read it - AK */ 1210 /* it's '1' under windows, when a dialog box appears 1211 * and you press one of the underlined keys - DF*/ 1212 1213 /* note that there is a test for all this */ 1214 if (dwFlags & KEYEVENTF_KEYUP ) 1215 { 1216 message = WM_KEYUP; 1217 if ((key_state_table[VK_MENU] & 0x80) && 1218 ((wVkStripped == VK_MENU) || (wVkStripped == VK_CONTROL) 1219 || !(key_state_table[VK_CONTROL] & 0x80))) 1220 { 1221 if( TrackSysKey == VK_MENU || /* <ALT>-down/<ALT>-up sequence */ 1222 (wVkStripped != VK_MENU)) /* <ALT>-down...<something else>-up */ 1223 message = WM_SYSKEYUP; 1224 TrackSysKey = 0; 1225 } 1226 key_state_table[wVk] &= ~0x80; 1227 key_state_table[wVkStripped] &= ~0x80; 1228 keylp.lp1.previous = 1; 1229 keylp.lp1.transition = 1; 1230 } 1231 else 1232 { 1233 keylp.lp1.previous = (key_state_table[wVk] & 0x80) != 0; 1234 keylp.lp1.transition = 0; 1235 if (!(key_state_table[wVk] & 0x80)) key_state_table[wVk] ^= 0x01; 1236 key_state_table[wVk] |= 0xc0; 1237 key_state_table[wVkStripped] |= 0xc0; 1238 1239 message = WM_KEYDOWN; 1240 if ((key_state_table[VK_MENU] & 0x80) && !(key_state_table[VK_CONTROL] & 0x80)) 1241 { 1242 message = WM_SYSKEYDOWN; 1243 TrackSysKey = wVkStripped; 1244 } 1245 } 1246 1247 keylp.lp1.context = (key_state_table[VK_MENU] & 0x80) != 0; /* 1 if alt */ 1248 1249 TRACE_(key)(" wParam=%04x, lParam=%08lx, InputKeyState=%x\n", 1250 wVk, keylp.lp2, key_state_table[wVk] ); 1251 1252 hook.vkCode = wVk; 1253 hook.scanCode = wScan; 1254 hook.flags = (keylp.lp2 >> 24) | injected_flags; 1255 hook.time = time; 1256 hook.dwExtraInfo = dwExtraInfo; 1257 if (HOOK_CallHooks( WH_KEYBOARD_LL, HC_ACTION, message, (LPARAM)&hook, TRUE )) return; 1258 1259 SERVER_START_REQ( send_hardware_message ) 1260 { 1261 req->id = (injected_flags & LLKHF_INJECTED) ? 0 : GetCurrentThreadId(); 1262 req->win = 0; 1263 req->msg = message; 1264 req->wparam = wVk; 1265 req->lparam = keylp.lp2; 1266 req->x = cursor_pos.x; 1267 req->y = cursor_pos.y; 1268 req->time = time; 1269 req->info = dwExtraInfo; 1270 wine_server_call( req ); 1271 } 1272 SERVER_END_REQ; 1273 #else // OUTOFWINE defined 1011 1274 // fill out our global structure 1012 1275 wineKeyboardInfo->wVk = wVk; … … 1014 1277 wineKeyboardInfo->dwFlags = dwFlags; 1015 1278 wineKeyboardInfo->time = time; 1016 #endif 1279 #endif // OUTOFWINE defined 1017 1280 } 1018 1281 1019 1282 1020 1283 /********************************************************************** 1021 * 1284 * KEYBOARD_GenerateMsg 1022 1285 * 1023 1286 * Generate Down+Up messages when NumLock or CapsLock is pressed. … … 1036 1299 And from there, a 'release' event will switch off the toggle key. */ 1037 1300 *State=FALSE; 1038 TRACE("INTERM : don\'t treat release of toggle key. InputKeyStateTable[%#x] = %#x\n",vkey,pKeyStateTable[vkey]); 1301 TRACE("INTERM : don't treat release of toggle key. key_state_table[%#x] = %#x\n", 1302 vkey,key_state_table[vkey]); 1039 1303 } else 1040 1304 { 1041 1305 down = (vkey==VK_NUMLOCK ? KEYEVENTF_EXTENDEDKEY : 0); 1042 1306 up = (vkey==VK_NUMLOCK ? KEYEVENTF_EXTENDEDKEY : 0) | KEYEVENTF_KEYUP; 1043 if ( pKeyStateTable[vkey] & 0x1 ) /* it was ON */1307 if ( key_state_table[vkey] & 0x1 ) /* it was ON */ 1044 1308 { 1045 1309 if (Evtype!=KeyPress) 1046 1310 { 1047 1311 TRACE("ON + KeyRelease => generating DOWN and UP messages.\n"); 1048 send_keyboard_input( vkey, scan, down, event_time);1049 send_keyboard_input( vkey, scan, up, event_time);1312 X11DRV_send_keyboard_input( vkey, scan, down, event_time, 0, 0 ); 1313 X11DRV_send_keyboard_input( vkey, scan, up, event_time, 0, 0 ); 1050 1314 *State=FALSE; 1051 pKeyStateTable[vkey] &= ~0x01; /* Toggle state to off. */1315 key_state_table[vkey] &= ~0x01; /* Toggle state to off. */ 1052 1316 } 1053 1317 } … … 1056 1320 { 1057 1321 TRACE("OFF + Keypress => generating DOWN and UP messages.\n"); 1058 send_keyboard_input( vkey, scan, down, event_time);1059 send_keyboard_input( vkey, scan, up, event_time);1322 X11DRV_send_keyboard_input( vkey, scan, down, event_time, 0, 0 ); 1323 X11DRV_send_keyboard_input( vkey, scan, up, event_time, 0, 0 ); 1060 1324 *State=TRUE; /* Goes to intermediary state before going to ON */ 1061 pKeyStateTable[vkey] |= 0x01; /* Toggle state to on. */1325 key_state_table[vkey] |= 0x01; /* Toggle state to on. */ 1062 1326 } 1063 1327 } … … 1073 1337 { 1074 1338 /* Do something if internal table state != X state for keycode */ 1075 if ((( pKeyStateTable[vkey] & 0x80)!=0) != state)1339 if (((key_state_table[vkey] & 0x80)!=0) != state) 1076 1340 { 1077 1341 TRACE("Adjusting state for vkey %#.2x. State before %#.2x\n", 1078 vkey, pKeyStateTable[vkey]);1342 vkey, key_state_table[vkey]); 1079 1343 1080 1344 /* Fake key being pressed inside wine */ 1081 send_keyboard_input( vkey, 0, state? 0 : KEYEVENTF_KEYUP, time);1082 1083 TRACE("State after %#.2x\n", pKeyStateTable[vkey]);1345 X11DRV_send_keyboard_input( vkey, 0, state? 0 : KEYEVENTF_KEYUP, time, 0, 0 ); 1346 1347 TRACE("State after %#.2x\n",key_state_table[vkey]); 1084 1348 } 1085 1349 } … … 1094 1358 * Toggle keys are handled in HandleEvent. 1095 1359 */ 1096 void X11DRV_KeymapNotify( HWND hwnd, X KeymapEvent *event )1360 void X11DRV_KeymapNotify( HWND hwnd, XEvent *event ) 1097 1361 { 1098 1362 int i, j, alt, control, shift; 1099 1363 #ifndef OUTOFWINE 1100 1364 DWORD time = GetCurrentTime(); 1101 #else 1365 #else // OUTOFWINE defined 1102 1366 // @@@AH todo! 1103 1367 DWORD time = 0; 1104 #endif 1368 #endif // OUTOFWINE defined 1105 1369 1106 1370 alt = control = shift = 0; 1107 for (i = 0; i < 32; i++) 1371 /* the minimum keycode is always greater or equal to 8, so we can 1372 * skip the first 8 values, hence start at 1 1373 */ 1374 for (i = 1; i < 32; i++) 1108 1375 { 1109 if (!event-> key_vector[i]) continue;1376 if (!event->xkeymap.key_vector[i]) continue; 1110 1377 for (j = 0; j < 8; j++) 1111 1378 { 1112 if (!(event-> key_vector[i] & (1<<j))) continue;1379 if (!(event->xkeymap.key_vector[i] & (1<<j))) continue; 1113 1380 switch(keyc2vkey[(i * 8) + j] & 0xff) 1114 1381 { … … 1130 1397 */ 1131 1398 #ifndef OUTOFWINE 1132 void X11DRV_KeyEvent( HWND hwnd, XKeyEvent *event ) 1133 #else 1134 void X11DRV_KeyEvent(XKeyEvent *event, WINEKEYBOARDINFO *wKbInfo) 1135 #endif 1136 { 1399 void X11DRV_KeyEvent( HWND hwnd, XEvent *xev ) 1400 #else // OUTOFWINE defined 1401 void X11DRV_KeyEvent(XEvent *xev, WINEKEYBOARDINFO *wKbInfo) 1402 #endif // OUTOFWINE defined 1403 { 1404 XKeyEvent *event = &xev->xkey; 1137 1405 char Str[24]; 1138 1406 KeySym keysym = 0; … … 1142 1410 #ifndef OUTOFWINE 1143 1411 XIC xic = X11DRV_get_ic( hwnd ); 1144 #else 1412 DWORD event_time = EVENT_x11_time_to_win32_time(event->time); 1413 #else // OUTOFWINE defined 1145 1414 // @@@AH do we need support for XIM? 1146 1415 XIC xic = 0; … … 1150 1419 wineKeyboardInfo = wKbInfo; 1151 1420 memset( wineKeyboardInfo, 0, sizeof( wineKeyboardInfo ) ); 1152 #endif 1153 DWORD event_time = event->time - X11DRV_server_startticks; 1421 // We don't use this anyway. 1422 DWORD event_time = 0; 1423 #endif // OUTOFWINE defined 1154 1424 Status status = 0; 1155 1425 … … 1158 1428 1159 1429 wine_tsx11_lock(); 1160 if (xic) 1430 /* Clients should pass only KeyPress events to XmbLookupString */ 1431 if (xic && event->type == KeyPress) 1161 1432 ascii_chars = XmbLookupString(xic, event, Str, sizeof(Str), &keysym, &status); 1162 1433 else 1163 1434 ascii_chars = XLookupString(event, Str, sizeof(Str), &keysym, NULL); 1164 1435 wine_tsx11_unlock(); 1165 1166 /* Ignore some unwanted events */1167 // @@@AH VBOX AltGr hack1168 // if (((keysym >= XK_ISO_Lock && keysym <= XK_ISO_Last_Group_Lock) ||1169 // keysym == XK_Mode_switch) && (keysym != XK_ISO_Level3_Shift))1170 /// @todo (dmik):1171 // the above |if| is too dangerous because it disables many key events1172 // (for example, both Shift release events when Left Shift + Right Shift1173 // is configured as a mode (group) switch.1174 if (keysym == XK_Mode_switch)1175 {1176 wine_tsx11_lock();1177 TRACE("Ignoring %s keyboard event\n", XKeysymToString(keysym));1178 wine_tsx11_unlock();1179 return;1180 }1181 1436 1182 1437 TRACE_(key)("state = %X nbyte = %d, status 0x%x\n", event->state, ascii_chars, status); … … 1191 1446 return; 1192 1447 } 1193 #endif 1448 #endif // OUTOFWINE not defined 1194 1449 1195 1450 /* If XKB extensions are used, the state mask for AltGr will use the group … … 1207 1462 Str[ascii_chars] = '\0'; 1208 1463 if (TRACE_ON(key)){ 1209 c har*ksname;1464 const char *ksname; 1210 1465 1211 1466 wine_tsx11_lock(); … … 1242 1497 // break; 1243 1498 // case VK_CAPITAL: 1244 // TRACE("Caps Lock event. (type %d). State before : %#.2x\n",event->type, pKeyStateTable[vkey]);1499 // TRACE("Caps Lock event. (type %d). State before : %#.2x\n",event->type,key_state_table[vkey]); 1245 1500 // KEYBOARD_GenerateMsg( VK_CAPITAL, 0x3A, event->type, event_time ); 1246 // TRACE("State after : %#.2x\n", pKeyStateTable[vkey]);1501 // TRACE("State after : %#.2x\n",key_state_table[vkey]); 1247 1502 // break; 1248 1503 // default: 1249 1504 // /* Adjust the NUMLOCK state if it has been changed outside wine */ 1250 // if (!(pKeyStateTable[VK_NUMLOCK] & 0x01) != !(event->state & NumLockMask))1251 // 1252 // 1253 // 1254 // 1255 // 1505 // if (!(key_state_table[VK_NUMLOCK] & 0x01) != !(event->state & NumLockMask)) 1506 // { 1507 // TRACE("Adjusting NumLock state.\n"); 1508 // KEYBOARD_GenerateMsg( VK_NUMLOCK, 0x45, KeyPress, event_time ); 1509 // KEYBOARD_GenerateMsg( VK_NUMLOCK, 0x45, KeyRelease, event_time ); 1510 // } 1256 1511 // /* Adjust the CAPSLOCK state if it has been changed outside wine */ 1257 // if (!(pKeyStateTable[VK_CAPITAL] & 0x01) != !(event->state & LockMask))1258 // 1512 // if (!(key_state_table[VK_CAPITAL] & 0x01) != !(event->state & LockMask)) 1513 // { 1259 1514 // TRACE("Adjusting Caps Lock state.\n"); 1260 // 1261 // 1262 // 1263 // 1264 // 1265 // 1515 // KEYBOARD_GenerateMsg( VK_CAPITAL, 0x3A, KeyPress, event_time ); 1516 // KEYBOARD_GenerateMsg( VK_CAPITAL, 0x3A, KeyRelease, event_time ); 1517 // } 1518 // /* Not Num nor Caps : end of intermediary states for both. */ 1519 // NumState = FALSE; 1520 // CapsState = FALSE; 1266 1521 1267 1522 bScan = keyc2scan[event->keycode] & 0xFF; … … 1272 1527 if ( vkey & 0x100 ) dwFlags |= KEYEVENTF_EXTENDEDKEY; 1273 1528 1274 send_keyboard_input( vkey & 0xff, bScan, dwFlags, event_time);1529 X11DRV_send_keyboard_input( vkey & 0xff, bScan, dwFlags, event_time, 0, 0 ); 1275 1530 // } 1276 1531 } … … 1278 1533 1279 1534 /********************************************************************** 1280 * 1535 * X11DRV_KEYBOARD_DetectLayout 1281 1536 * 1282 1537 * Called from X11DRV_InitKeyboard … … 1291 1546 unsigned current, match, mismatch, seq, i, syms; 1292 1547 int score, keyc, key, pkey, ok; 1293 KeySym keysym ;1548 KeySym keysym = 0; 1294 1549 const char (*lkey)[MAIN_LEN][4]; 1295 1550 unsigned max_seq = 0; 1296 1551 int max_score = 0, ismatch = 0; 1297 char ckey[4] = 1298 {0, 0, 0, 0}; 1552 char ckey[256][4]; 1299 1553 1300 1554 syms = keysyms_per_keycode; … … 1303 1557 syms = 4; 1304 1558 } 1559 1560 memset( ckey, 0, sizeof(ckey) ); 1561 for (keyc = min_keycode; keyc <= max_keycode; keyc++) { 1562 /* get data for keycode from X server */ 1563 for (i = 0; i < syms; i++) { 1564 if (!(keysym = XKeycodeToKeysym (display, keyc, i))) continue; 1565 /* Allow both one-byte and two-byte national keysyms */ 1566 if ((keysym < 0x8000) && (keysym != ' ')) 1567 { 1568 #ifdef HAVE_XKB 1569 if (!use_xkb || !XkbTranslateKeySym(display, &keysym, 0, &ckey[keyc][i], 1, NULL)) 1570 #endif 1571 { 1572 TRACE("XKB could not translate keysym %ld\n", keysym); 1573 /* FIXME: query what keysym is used as Mode_switch, fill XKeyEvent 1574 * with appropriate ShiftMask and Mode_switch, use XLookupString 1575 * to get character in the local encoding. 1576 */ 1577 ckey[keyc][i] = keysym & 0xFF; 1578 } 1579 } 1580 else { 1581 ckey[keyc][i] = KEYBOARD_MapDeadKeysym(keysym); 1582 } 1583 } 1584 } 1585 1305 1586 for (current = 0; main_key_tab[current].comment; current++) { 1306 1587 TRACE("Attempting to match against \"%s\"\n", main_key_tab[current].comment); … … 1312 1593 pkey = -1; 1313 1594 for (keyc = min_keycode; keyc <= max_keycode; keyc++) { 1314 /* get data for keycode from X server */ 1315 for (i = 0; i < syms; i++) { 1316 keysym = XKeycodeToKeysym (display, keyc, i); 1317 /* Allow both one-byte and two-byte national keysyms */ 1318 if ((keysym < 0x8000) && (keysym != ' ')) 1319 { 1320 #ifdef HAVE_XKB 1321 if (!use_xkb || !XkbTranslateKeySym(display, &keysym, 0, &ckey[i], 1, NULL)) 1322 #endif 1323 { 1324 TRACE("XKB could not translate keysym %ld\n", keysym); 1325 /* FIXME: query what keysym is used as Mode_switch, fill XKeyEvent 1326 * with appropriate ShiftMask and Mode_switch, use XLookupString 1327 * to get character in the local encoding. 1328 */ 1329 ckey[i] = keysym & 0xFF; 1330 } 1331 } 1332 else { 1333 ckey[i] = KEYBOARD_MapDeadKeysym(keysym); 1334 } 1335 } 1336 if (ckey[0]) { 1595 if (ckey[keyc][0]) { 1337 1596 /* search for a match in layout table */ 1338 1597 /* right now, we just find an absolute match for defined positions */ 1339 1598 /* (undefined positions are ignored, so if it's defined as "3#" in */ 1340 /* the table, it's okay that the X server has "3# £", for example) */1599 /* the table, it's okay that the X server has "3#�", for example) */ 1341 1600 /* however, the score will be higher for longer matches */ 1342 1601 for (key = 0; key < MAIN_LEN; key++) { 1343 1602 for (ok = 0, i = 0; (ok >= 0) && (i < syms); i++) { 1344 if ((*lkey)[key][i] && ((*lkey)[key][i] == ckey[ i]))1603 if ((*lkey)[key][i] && ((*lkey)[key][i] == ckey[keyc][i])) 1345 1604 ok++; 1346 if ((*lkey)[key][i] && ((*lkey)[key][i] != ckey[ i]))1605 if ((*lkey)[key][i] && ((*lkey)[key][i] != ckey[keyc][i])) 1347 1606 ok = -1; 1348 1607 } … … 1360 1619 } else { 1361 1620 /* print spaces instead of \0's */ 1362 for (i = 0; i < sizeof(ckey); i++) if (!ckey[i]) ckey[i] = ' '; 1363 TRACE_(key)("mismatch for keysym 0x%04lX, keycode %d, got %c%c%c%c\n", 1364 keysym, keyc, ckey[0], ckey[1], ckey[2], ckey[3]); 1365 mismatch++; 1366 score -= syms; 1621 char str[5]; 1622 for (i = 0; i < 4; i++) str[i] = ckey[keyc][i] ? ckey[keyc][i] : ' '; 1623 str[4] = 0; 1624 TRACE_(key)("mismatch for keysym 0x%04lX, keycode %d, got %s\n", keysym, keyc, str ); 1625 mismatch++; 1626 score -= syms; 1367 1627 } 1368 1628 } … … 1388 1648 1389 1649 /********************************************************************** 1390 * InitKeyboard (X11DRV.@)1650 * X11DRV_InitKeyboard 1391 1651 */ 1392 void X11DRV_InitKeyboard( BYTE *key_state_table)1652 void X11DRV_InitKeyboard(void) 1393 1653 { 1394 1654 Display *display = thread_display(); … … 1402 1662 char ckey[4]={0,0,0,0}; 1403 1663 const char (*lkey)[MAIN_LEN][4]; 1404 1405 pKeyStateTable = key_state_table; 1664 char vkey_used[256] = { 0 }; 1406 1665 1407 1666 wine_tsx11_lock(); … … 1447 1706 1448 1707 OEMvkey = VK_OEM_8; /* next is available. */ 1708 memset(keyc2vkey, 0, sizeof(keyc2vkey)); 1449 1709 for (keyc = min_keycode; keyc <= max_keycode; keyc++) 1450 1710 { … … 1464 1724 /* set extended bit when necessary */ 1465 1725 if (scan & 0x100) vkey |= 0x100; 1726 } else if ((keysym >> 8) == 0x1008FF) { /* XFree86 vendor keys */ 1727 vkey = xfree86_vendor_key_vkey[keysym & 0xff]; 1728 /* All vendor keys are extended with a scan code of 0 per testing on WinXP */ 1729 scan = 0x100; 1730 vkey |= 0x100; 1466 1731 } else if (keysym == 0x20) { /* Spacebar */ 1467 1732 vkey = VK_SPACE; … … 1492 1757 for (ok=(*lkey)[keyn][i=0]; ok&&(i<4); i++) 1493 1758 if ((*lkey)[keyn][i] && (*lkey)[keyn][i]!=ckey[i]) ok=0; 1759 if (!ok) i--; /* we overshot */ 1494 1760 if (ok||(i>maxlen)) { 1495 1761 maxlen=i; maxval=keyn; … … 1505 1771 } 1506 1772 } 1507 #if 0 /* this breaks VK_OEM_x VKeys in some layout tables by inserting 1508 * a VK code into a not appropriate place. 1509 */ 1510 /* find a suitable layout-dependent VK code */ 1511 /* (most Winelib apps ought to be able to work without layout tables!) */ 1512 for (i = 0; (i < keysyms_per_keycode) && (!vkey); i++) 1773 } 1774 TRACE("keycode %04x => vkey %04x\n", e2.keycode, vkey); 1775 keyc2vkey[e2.keycode] = vkey; 1776 keyc2scan[e2.keycode] = scan; 1777 if ((vkey & 0xff) && vkey_used[(vkey & 0xff)]) 1778 WARN("vkey %04x is being used by more than one keycode\n", vkey); 1779 vkey_used[(vkey & 0xff)] = 1; 1780 } /* for */ 1781 1782 #define VKEY_IF_NOT_USED(vkey) (vkey_used[(vkey)] ? 0 : (vkey_used[(vkey)] = 1, (vkey))) 1783 for (keyc = min_keycode; keyc <= max_keycode; keyc++) 1784 { 1785 vkey = keyc2vkey[keyc] & 0xff; 1786 if (vkey) 1787 continue; 1788 1789 e2.keycode = (KeyCode)keyc; 1790 keysym = XLookupKeysym(&e2, 0); 1791 if (!keysym) 1792 continue; 1793 1794 /* find a suitable layout-dependent VK code */ 1795 /* (most Winelib apps ought to be able to work without layout tables!) */ 1796 for (i = 0; (i < keysyms_per_keycode) && (!vkey); i++) 1797 { 1798 keysym = XLookupKeysym(&e2, i); 1799 if ((keysym >= XK_0 && keysym <= XK_9) 1800 || (keysym >= XK_A && keysym <= XK_Z)) { 1801 vkey = VKEY_IF_NOT_USED(keysym); 1802 } 1803 } 1804 1805 for (i = 0; (i < keysyms_per_keycode) && (!vkey); i++) 1806 { 1807 keysym = XLookupKeysym(&e2, i); 1808 switch (keysym) 1513 1809 { 1514 keysym = XLookupKeysym(&e2, i); 1515 if ((keysym >= VK_0 && keysym <= VK_9) 1516 || (keysym >= VK_A && keysym <= VK_Z)) { 1517 vkey = keysym; 1518 } 1810 case ';': vkey = VKEY_IF_NOT_USED(VK_OEM_1); break; 1811 case '/': vkey = VKEY_IF_NOT_USED(VK_OEM_2); break; 1812 case '`': vkey = VKEY_IF_NOT_USED(VK_OEM_3); break; 1813 case '[': vkey = VKEY_IF_NOT_USED(VK_OEM_4); break; 1814 case '\\': vkey = VKEY_IF_NOT_USED(VK_OEM_5); break; 1815 case ']': vkey = VKEY_IF_NOT_USED(VK_OEM_6); break; 1816 case '\'': vkey = VKEY_IF_NOT_USED(VK_OEM_7); break; 1817 case ',': vkey = VKEY_IF_NOT_USED(VK_OEM_COMMA); break; 1818 case '.': vkey = VKEY_IF_NOT_USED(VK_OEM_PERIOD); break; 1819 case '-': vkey = VKEY_IF_NOT_USED(VK_OEM_MINUS); break; 1820 case '+': vkey = VKEY_IF_NOT_USED(VK_OEM_PLUS); break; 1519 1821 } 1520 1521 for (i = 0; (i < keysyms_per_keycode) && (!vkey); i++) 1822 } 1823 1824 if (!vkey) 1825 { 1826 /* Others keys: let's assign OEM virtual key codes in the allowed range, 1827 * that is ([0xba,0xc0], [0xdb,0xe4], 0xe6 (given up) et [0xe9,0xf5]) */ 1828 do 1522 1829 { 1523 keysym = XLookupKeysym(&e2, i);1524 switch (keysym)1525 {1526 case ';': vkey = VK_OEM_1; break;1527 case '/': vkey = VK_OEM_2; break;1528 case '`': vkey = VK_OEM_3; break;1529 case '[': vkey = VK_OEM_4; break;1530 case '\\': vkey = VK_OEM_5; break;1531 case ']': vkey = VK_OEM_6; break;1532 case '\'': vkey = VK_OEM_7; break;1533 case ',': vkey = VK_OEM_COMMA; break;1534 case '.': vkey = VK_OEM_PERIOD; break;1535 case '-': vkey = VK_OEM_MINUS; break;1536 case '+': vkey = VK_OEM_PLUS; break;1537 }1538 }1539 #endif1540 if (!vkey)1541 {1542 // @@@AH VBOX hack for AltGr1543 if (e2.keycode == 0x71)1544 {1545 TRACE("VBOX HACK, mapping keycode 0x71 to scancode %X\n", VK_MENU);1546 vkey = VK_MENU | 0x100;1547 } else {1548 /* Others keys: let's assign OEM virtual key codes in the allowed range,1549 * that is ([0xba,0xc0], [0xdb,0xe4], 0xe6 (given up) et [0xe9,0xf5]) */1550 1830 switch (++OEMvkey) 1551 1831 { … … 1554 1834 case 0xf6 : OEMvkey=0xf5; WARN("No more OEM vkey available!\n"); 1555 1835 } 1556 1557 vkey = OEMvkey; 1558 1559 if (TRACE_ON(keyboard)) 1836 } while (OEMvkey < 0xf5 && vkey_used[OEMvkey]); 1837 1838 vkey = VKEY_IF_NOT_USED(OEMvkey); 1839 1840 if (TRACE_ON(keyboard)) 1841 { 1842 TRACE("OEM specific virtual key %X assigned to keycode %X:\n", 1843 OEMvkey, e2.keycode); 1844 TRACE("("); 1845 for (i = 0; i < keysyms_per_keycode; i += 1) 1560 1846 { 1561 TRACE("OEM specific virtual key %X assigned to keycode %X:\n", 1562 OEMvkey, e2.keycode); 1563 TRACE("("); 1564 for (i = 0; i < keysyms_per_keycode; i += 1) 1565 { 1566 char *ksname; 1567 1568 keysym = XLookupKeysym(&e2, i); 1569 ksname = XKeysymToString(keysym); 1570 if (!ksname) 1571 ksname = "NoSymbol"; 1572 TRACE( "%lX (%s) ", keysym, ksname); 1573 } 1574 TRACE(")\n"); 1847 const char *ksname; 1848 1849 keysym = XLookupKeysym(&e2, i); 1850 ksname = XKeysymToString(keysym); 1851 if (!ksname) 1852 ksname = "NoSymbol"; 1853 TRACE( "%lX (%s) ", keysym, ksname); 1575 1854 } 1576 }} 1855 TRACE(")\n"); 1856 } 1577 1857 } 1578 TRACE("keycode %04x => vkey %04x\n", e2.keycode, vkey); 1579 keyc2vkey[e2.keycode] = vkey; 1580 keyc2scan[e2.keycode] = scan; 1858 1859 if (vkey) 1860 { 1861 TRACE("keycode %04x => vkey %04x\n", e2.keycode, vkey); 1862 keyc2vkey[e2.keycode] = vkey; 1863 } 1581 1864 } /* for */ 1865 #undef VKEY_IF_NOT_USED 1582 1866 1583 1867 /* If some keys still lack scancodes, assign some arbitrary ones to them now */ 1584 1868 for (scan = 0x60, keyc = min_keycode; keyc <= max_keycode; keyc++) 1585 1869 if (keyc2vkey[keyc]&&!keyc2scan[keyc]) { 1586 c har *ksname;1870 const char *ksname; 1587 1871 keysym = XKeycodeToKeysym(display, keyc, 0); 1588 1872 ksname = XKeysymToString(keysym); … … 1615 1899 1616 1900 #ifndef OUTOFWINE 1901 /********************************************************************** 1902 * GetAsyncKeyState (X11DRV.@) 1903 */ 1904 SHORT X11DRV_GetAsyncKeyState(INT key) 1905 { 1906 SHORT retval; 1907 1908 X11DRV_MsgWaitForMultipleObjectsEx( 0, NULL, 0, QS_KEY, 0 ); 1909 1910 retval = ((key_state_table[key] & 0x40) ? 0x0001 : 0) | 1911 ((key_state_table[key] & 0x80) ? 0x8000 : 0); 1912 key_state_table[key] &= ~0x40; 1913 TRACE_(key)("(%x) -> %x\n", key, retval); 1914 return retval; 1915 } 1916 1917 1617 1918 /*********************************************************************** 1618 * 1919 * GetKeyboardLayoutList (X11DRV.@) 1619 1920 */ 1620 1921 UINT X11DRV_GetKeyboardLayoutList(INT size, HKL *hkl) … … 1633 1934 { 1634 1935 if (hkl) 1635 hkl[i] = (HKL)main_key_tab[i].lcid; 1936 { 1937 ULONG_PTR layout = main_key_tab[i].lcid; 1938 LANGID langid; 1939 1940 /* see comment for GetKeyboardLayout */ 1941 langid = PRIMARYLANGID(LANGIDFROMLCID(layout)); 1942 if (langid == LANG_CHINESE || langid == LANG_JAPANESE || langid == LANG_KOREAN) 1943 layout |= 0xe001 << 16; /* FIXME */ 1944 else 1945 layout |= layout << 16; 1946 1947 hkl[i] = (HKL)layout; 1948 } 1636 1949 } 1637 1950 return i; … … 1640 1953 1641 1954 /*********************************************************************** 1642 * 1955 * GetKeyboardLayout (X11DRV.@) 1643 1956 */ 1644 1957 HKL X11DRV_GetKeyboardLayout(DWORD dwThreadid) 1645 1958 { 1646 DWORDlayout;1959 ULONG_PTR layout; 1647 1960 LANGID langid; 1648 1961 1649 if (dwThreadid )1650 FIXME("couldn't return keyboard layout for thread %04 lx\n", dwThreadid);1962 if (dwThreadid && dwThreadid != GetCurrentThreadId()) 1963 FIXME("couldn't return keyboard layout for thread %04x\n", dwThreadid); 1651 1964 1652 1965 #if 0 … … 1662 1975 layout = GetUserDefaultLCID(); 1663 1976 #endif 1664 /* 1977 /* 1665 1978 * Microsoft Office expects this value to be something specific 1666 1979 * for Japanese and Korean Windows with an IME the value is 0xe001 … … 1671 1984 if (langid == LANG_CHINESE || langid == LANG_JAPANESE || langid == LANG_KOREAN) 1672 1985 layout |= 0xe001 << 16; /* FIXME */ 1986 else 1987 layout |= layout << 16; 1673 1988 1674 1989 return (HKL)layout; … … 1677 1992 1678 1993 /*********************************************************************** 1679 * 1994 * GetKeyboardLayoutName (X11DRV.@) 1680 1995 */ 1681 1996 BOOL X11DRV_GetKeyboardLayoutName(LPWSTR name) … … 1686 2001 1687 2002 layout = main_key_tab[kbd_layout].lcid; 1688 /* see comment above*/2003 /* see comment for GetKeyboardLayout */ 1689 2004 langid = PRIMARYLANGID(LANGIDFROMLCID(layout)); 1690 2005 if (langid == LANG_CHINESE || langid == LANG_JAPANESE || langid == LANG_KOREAN) 1691 2006 layout |= 0xe001 << 16; /* FIXME */ 2007 else 2008 layout |= layout << 16; 1692 2009 1693 2010 sprintfW(name, formatW, layout); … … 1698 2015 1699 2016 /*********************************************************************** 1700 * 2017 * LoadKeyboardLayout (X11DRV.@) 1701 2018 */ 1702 2019 HKL X11DRV_LoadKeyboardLayout(LPCWSTR name, UINT flags) … … 1709 2026 1710 2027 /*********************************************************************** 1711 * 2028 * UnloadKeyboardLayout (X11DRV.@) 1712 2029 */ 1713 2030 BOOL X11DRV_UnloadKeyboardLayout(HKL hkl) … … 1720 2037 1721 2038 /*********************************************************************** 1722 * 2039 * ActivateKeyboardLayout (X11DRV.@) 1723 2040 */ 1724 2041 HKL X11DRV_ActivateKeyboardLayout(HKL hkl, UINT flags) … … 1733 2050 * X11DRV_MappingNotify 1734 2051 */ 1735 void X11DRV_MappingNotify( XMappingEvent *event )2052 void X11DRV_MappingNotify( HWND dummy, XEvent *event ) 1736 2053 { 1737 2054 HWND hwnd; 1738 2055 1739 2056 wine_tsx11_lock(); 1740 XRefreshKeyboardMapping( event);2057 XRefreshKeyboardMapping(&event->xmapping); 1741 2058 wine_tsx11_unlock(); 1742 X11DRV_InitKeyboard( pKeyStateTable);2059 X11DRV_InitKeyboard(); 1743 2060 1744 2061 hwnd = GetFocus(); … … 1750 2067 1751 2068 /*********************************************************************** 1752 * 2069 * VkKeyScanEx (X11DRV.@) 1753 2070 * 1754 2071 * Note: Windows ignores HKL parameter and uses current active layout instead … … 1763 2080 SHORT ret; 1764 2081 2082 /* FIXME: what happens if wChar is not a Latin1 character and CP_UNIXCP 2083 * is UTF-8 (multibyte encoding)? 2084 */ 1765 2085 if (!WideCharToMultiByte(CP_UNIXCP, 0, &wChar, 1, &cChar, 1, NULL, NULL)) 1766 2086 { … … 1778 2098 keycode = XKeysymToKeycode(display, keysym); /* keysym -> keycode */ 1779 2099 if (!keycode) 1780 { /* It didn't work ... let's try with deadchar code. */ 2100 { 2101 if (keysym >= 0xFF00) /* Windows returns 0x0240 + cChar in this case */ 2102 { 2103 ret = 0x0240 + cChar; /* 0x0200 indicates a control character */ 2104 TRACE(" ... returning ctrl char %#.2x\n", ret); 2105 wine_tsx11_unlock(); 2106 return ret; 2107 } 2108 /* It didn't work ... let's try with deadchar code. */ 1781 2109 TRACE("retrying with | 0xFE00\n"); 1782 2110 keycode = XKeysymToKeycode(display, keysym | 0xFE00); … … 1833 2161 1834 2162 /*********************************************************************** 1835 * 2163 * MapVirtualKeyEx (X11DRV.@) 1836 2164 */ 1837 2165 UINT X11DRV_MapVirtualKeyEx(UINT wCode, UINT wMapType, HKL hkl) … … 1846 2174 1847 2175 switch(wMapType) { 1848 case 0: 2176 case 0: { /* vkey-code to scan-code */ 1849 2177 /* let's do vkey -> keycode -> scan */ 1850 2178 int keyc; … … 1906 2234 if (!e.keycode) 1907 2235 { 1908 WARN("Unknown virtual key %X !!! 2236 WARN("Unknown virtual key %X !!!\n", wCode); 1909 2237 wine_tsx11_unlock(); 1910 2238 return 0; /* whatever */ … … 1924 2252 1925 2253 case 3: /* **NT only** scan-code to vkey-code but distinguish between */ 1926 2254 /* left and right */ 1927 2255 FIXME(" stub for NT\n"); 1928 2256 return 0; … … 1936 2264 1937 2265 /*********************************************************************** 1938 * 2266 * GetKeyNameText (X11DRV.@) 1939 2267 */ 1940 2268 INT X11DRV_GetKeyNameText(LONG lParam, LPWSTR lpBuffer, INT nSize) … … 2026 2354 } 2027 2355 2028 /* Finally issue FIXMEfor unknown keys */2029 2030 FIXME("(%08lx,%p,%d): unsupported key, vkey=%04x, ansi=%04x\n",lParam,lpBuffer,nSize,vkey,ansi);2356 /* Finally issue WARN for unknown keys */ 2357 2358 WARN("(%08x,%p,%d): unsupported key, vkey=%04x, ansi=%04x\n",lParam,lpBuffer,nSize,vkey,ansi); 2031 2359 if (lpBuffer && nSize) 2032 2360 *lpBuffer = 0; 2033 2361 return 0; 2034 2362 } 2035 #endif // OUTOFWINE 2363 #endif // OUTOFWINE not defined 2036 2364 2037 2365 /*********************************************************************** 2038 * 2366 * X11DRV_KEYBOARD_MapDeadKeysym 2039 2367 */ 2040 2368 static char KEYBOARD_MapDeadKeysym(KeySym keysym) … … 2047 2375 #endif 2048 2376 case 0x1000FE7E : /* Xfree's XK_Dtilde */ 2049 return '~'; 2377 return '~'; /* '? */ 2050 2378 #ifdef XK_dead_acute 2051 2379 case XK_dead_acute : 2052 2380 #endif 2053 2381 case 0x1000FE27 : /* Xfree's XK_Dacute_accent */ 2054 return 0xb4; 2382 return 0xb4; /* '' */ 2055 2383 #ifdef XK_dead_circumflex 2056 2384 case XK_dead_circumflex: 2057 2385 #endif 2058 2386 case 0x1000FE5E : /* Xfree's XK_Dcircumflex_accent */ 2059 return '^'; 2387 return '^'; /* '> */ 2060 2388 #ifdef XK_dead_grave 2061 2389 case XK_dead_grave : 2062 2390 #endif 2063 2391 case 0x1000FE60 : /* Xfree's XK_Dgrave_accent */ 2064 return '`'; 2392 return '`'; /* '! */ 2065 2393 #ifdef XK_dead_diaeresis 2066 2394 case XK_dead_diaeresis : 2067 2395 #endif 2068 2396 case 0x1000FE22 : /* Xfree's XK_Ddiaeresis */ 2069 return 0xa8; 2397 return 0xa8; /* ': */ 2070 2398 #ifdef XK_dead_cedilla 2071 2399 case XK_dead_cedilla : 2072 return 0xb8; 2400 return 0xb8; /* ', */ 2073 2401 #endif 2074 2402 #ifdef XK_dead_macron 2075 2403 case XK_dead_macron : 2076 return '-'; 2404 return '-'; /* 'm isn't defined on iso-8859-x */ 2077 2405 #endif 2078 2406 #ifdef XK_dead_breve 2079 2407 case XK_dead_breve : 2080 return 0xa2; 2408 return 0xa2; /* '( */ 2081 2409 #endif 2082 2410 #ifdef XK_dead_abovedot 2083 2411 case XK_dead_abovedot : 2084 return 0xff; 2412 return 0xff; /* '. */ 2085 2413 #endif 2086 2414 #ifdef XK_dead_abovering 2087 2415 case XK_dead_abovering : 2088 return '0'; 2416 return '0'; /* '0 isn't defined on iso-8859-x */ 2089 2417 #endif 2090 2418 #ifdef XK_dead_doubleacute 2091 2419 case XK_dead_doubleacute : 2092 return 0xbd; 2420 return 0xbd; /* '" */ 2093 2421 #endif 2094 2422 #ifdef XK_dead_caron 2095 2423 case XK_dead_caron : 2096 return 0xb7; 2424 return 0xb7; /* '< */ 2097 2425 #endif 2098 2426 #ifdef XK_dead_ogonek 2099 2427 case XK_dead_ogonek : 2100 return 0xb2; 2428 return 0xb2; /* '; */ 2101 2429 #endif 2102 2430 /* FIXME: I don't know this three. … … 2115 2443 #ifndef OUTOFWINE 2116 2444 /*********************************************************************** 2117 * 2445 * ToUnicodeEx (X11DRV.@) 2118 2446 * 2119 2447 * The ToUnicode function translates the specified virtual-key code and keyboard … … 2122 2450 * If the specified key is a dead key, the return value is negative. Otherwise, 2123 2451 * it is one of the following values: 2124 * Value 2125 * 0 2126 * 1 2127 * 2 2452 * Value Meaning 2453 * 0 The specified virtual key has no translation for the current state of the keyboard. 2454 * 1 One Windows character was copied to the buffer. 2455 * 2 Two characters were copied to the buffer. This usually happens when a 2128 2456 * dead-key character (accent or diacritic) stored in the keyboard layout cannot 2129 2457 * be composed with the specified virtual key to form a single character. … … 2143 2471 HWND focus; 2144 2472 XIC xic; 2473 Status status; 2145 2474 2146 2475 if (scanCode & 0x8000) … … 2152 2481 if (hkl != X11DRV_GetKeyboardLayout(0)) 2153 2482 FIXME("keyboard layout %p is not supported\n", hkl); 2483 2484 if ((lpKeyState[VK_MENU] & 0x80) && (lpKeyState[VK_CONTROL] & 0x80)) 2485 { 2486 TRACE("Ctrl+Alt+[key] won't generate a character\n"); 2487 return 0; 2488 } 2154 2489 2155 2490 e.display = display; … … 2205 2540 } 2206 2541 2542 if (virtKey >= VK_LEFT && virtKey <= VK_DOWN) 2543 e.keycode = XKeysymToKeycode(e.display, virtKey - VK_LEFT + XK_Left); 2544 2207 2545 if ((virtKey>=VK_NUMPAD0) && (virtKey<=VK_NUMPAD9)) 2208 2546 e.keycode = XKeysymToKeycode(e.display, virtKey-VK_NUMPAD0+XK_KP_0); … … 2211 2549 e.keycode = XKeysymToKeycode(e.display, XK_KP_Decimal); 2212 2550 2551 if (virtKey==VK_SEPARATOR) 2552 e.keycode = XKeysymToKeycode(e.display, XK_KP_Separator); 2553 2213 2554 if (!e.keycode && virtKey != VK_NONAME) 2214 2555 { 2215 WARN("Unknown virtual key %X !!! \n",virtKey);2556 WARN("Unknown virtual key %X !!!\n", virtKey); 2216 2557 wine_tsx11_unlock(); 2217 return virtKey; /* whatever */2558 return 0; 2218 2559 } 2219 2560 else TRACE("Found keycode %d (0x%2X)\n",e.keycode,e.keycode); … … 2222 2563 e.type, e.window, e.state, e.keycode); 2223 2564 2565 /* Clients should pass only KeyPress events to XmbLookupString, 2566 * e.type was set to KeyPress above. 2567 */ 2224 2568 if (xic) 2225 ret = XmbLookupString(xic, &e, lpChar, sizeof(lpChar), &keysym, NULL);2569 ret = XmbLookupString(xic, &e, lpChar, sizeof(lpChar), &keysym, &status); 2226 2570 else 2227 2571 ret = XLookupString(&e, lpChar, sizeof(lpChar), &keysym, NULL); … … 2229 2573 2230 2574 if (ret == 0) 2231 2232 BYTEdead_char;2575 { 2576 char dead_char; 2233 2577 2234 2578 #ifdef XK_EuroSign … … 2242 2586 } 2243 2587 #endif 2588 /* Special case: X turns shift-tab into ISO_Left_Tab. */ 2589 /* Here we change it back. */ 2590 if (keysym == XK_ISO_Left_Tab) 2591 { 2592 bufW[0] = 0x09; 2593 ret = 1; 2594 goto found; 2595 } 2596 2244 2597 dead_char = KEYBOARD_MapDeadKeysym(keysym); 2245 2598 if (dead_char) 2246 2599 { 2247 2600 MultiByteToWideChar(CP_UNIXCP, 0, &dead_char, 1, bufW, bufW_size); 2248 2601 ret = -1; 2249 } 2602 goto found; 2603 } 2604 2605 if (keysym >= 0x01000100 && keysym <= 0x0100ffff) 2606 { 2607 /* Unicode direct mapping */ 2608 bufW[0] = keysym & 0xffff; 2609 ret = 1; 2610 goto found; 2611 } 2612 else if ((keysym >> 8) == 0x1008FF) { 2613 bufW[0] = 0; 2614 ret = 0; 2615 goto found; 2616 } 2250 2617 else 2251 2618 { 2252 c har*ksname;2619 const char *ksname; 2253 2620 2254 2621 wine_tsx11_lock(); … … 2259 2626 if ((keysym >> 8) != 0xff) 2260 2627 { 2261 ERR("Please report:no char for keysym %04lX (%s) :\n",2628 WARN("no char for keysym %04lX (%s) :\n", 2262 2629 keysym, ksname); 2263 ERR("(virtKey=%X,scanCode=%X,keycode=%X,state=%X)\n",2630 WARN("virtKey=%X, scanCode=%X, keycode=%X, state=%X\n", 2264 2631 virtKey, scanCode, e.keycode, e.state); 2265 2632 } … … 2303 2670 } 2304 2671 2672 /* Hack to detect an XLookupString hard-coded to Latin1 */ 2673 if (ret == 1 && keysym >= 0x00a0 && keysym <= 0x00ff && (BYTE)lpChar[0] == keysym) 2674 { 2675 bufW[0] = (BYTE)lpChar[0]; 2676 goto found; 2677 } 2678 2305 2679 /* perform translation to unicode */ 2306 2680 if(ret) … … 2318 2692 2319 2693 /*********************************************************************** 2320 * 2694 * Beep (X11DRV.@) 2321 2695 */ 2322 2696 void X11DRV_Beep(void) … … 2326 2700 wine_tsx11_unlock(); 2327 2701 } 2328 #endif // OUTOFWINE 2329 2330 #ifdef OUTOFWINE 2702 #else // OUTOFWINE defined 2331 2703 int X11DRV_GetKeysymsPerKeycode() 2332 2704 { 2333 2705 return keysyms_per_keycode; 2334 2706 } 2335 #endif 2707 #endif // OUTOFWINE defined -
trunk/src/VBox/Frontends/VirtualBox/src/linux/keyboard_outofwine.h
r382 r2529 24 24 typedef unsigned short WORD; 25 25 typedef unsigned long DWORD; 26 typedef unsigned int UINT; 26 27 typedef long BOOL; 27 28 typedef DWORD LCID; … … 89 90 #define VK_PAUSE 0x13 90 91 #define VK_CAPITAL 0x14 91 /* 0x15-0x19 Reserved for Kanji systems */ 92 93 #define VK_KANA 0x15 94 #define VK_HANGEUL 0x15 95 #define VK_HANGUL 0x15 96 #define VK_JUNJA 0x17 97 #define VK_FINAL 0x18 98 #define VK_HANJA 0x19 99 #define VK_KANJI 0x19 100 92 101 /* 0x1A Undefined */ 93 102 #define VK_ESCAPE 0x1B 94 /* 0x1C-0x1F Reserved for Kanji systems */ 103 104 #define VK_CONVERT 0x1C 105 #define VK_NONCONVERT 0x1D 106 #define VK_ACCEPT 0x1E 107 #define VK_MODECHANGE 0x1F 108 95 109 #define VK_SPACE 0x20 96 110 #define VK_PRIOR 0x21 … … 109 123 #define VK_DELETE 0x2E 110 124 #define VK_HELP 0x2F 111 #define VK_0 0x30 112 #define VK_1 0x31 113 #define VK_2 0x32 114 #define VK_3 0x33 115 #define VK_4 0x34 116 #define VK_5 0x35 117 #define VK_6 0x36 118 #define VK_7 0x37 119 #define VK_8 0x38 120 #define VK_9 0x39 125 /* VK_0 - VK-9 0x30-0x39 Use ASCII instead */ 121 126 /* 0x3A-0x40 Undefined */ 122 #define VK_A 0x41 123 #define VK_B 0x42 124 #define VK_C 0x43 125 #define VK_D 0x44 126 #define VK_E 0x45 127 #define VK_F 0x46 128 #define VK_G 0x47 129 #define VK_H 0x48 130 #define VK_I 0x49 131 #define VK_J 0x4A 132 #define VK_K 0x4B 133 #define VK_L 0x4C 134 #define VK_M 0x4D 135 #define VK_N 0x4E 136 #define VK_O 0x4F 137 #define VK_P 0x50 138 #define VK_Q 0x51 139 #define VK_R 0x52 140 #define VK_S 0x53 141 #define VK_T 0x54 142 #define VK_U 0x55 143 #define VK_V 0x56 144 #define VK_W 0x57 145 #define VK_X 0x58 146 #define VK_Y 0x59 147 #define VK_Z 0x5A 148 127 /* VK_A - VK_Z 0x41-0x5A Use ASCII instead */ 149 128 #define VK_LWIN 0x5B 150 129 #define VK_RWIN 0x5C 151 130 #define VK_APPS 0x5D 152 /* 0x5E-0x5F Unassigned */ 131 /* 0x5E Unassigned */ 132 #define VK_SLEEP 0x5F 153 133 #define VK_NUMPAD0 0x60 154 134 #define VK_NUMPAD1 0x61 … … 194 174 #define VK_NUMLOCK 0x90 195 175 #define VK_SCROLL 0x91 196 /* 0x92-0x9F Unassigned */ 176 #define VK_OEM_NEC_EQUAL 0x92 177 #define VK_OEM_FJ_JISHO 0x92 178 #define VK_OEM_FJ_MASSHOU 0x93 179 #define VK_OEM_FJ_TOUROKU 0x94 180 #define VK_OEM_FJ_LOYA 0x95 181 #define VK_OEM_FJ_ROYA 0x96 182 /* 0x97-0x9F Unassigned */ 197 183 /* 198 184 * differencing between right and left shift/control/alt key. … … 205 191 #define VK_LMENU 0xA4 206 192 #define VK_RMENU 0xA5 207 /* 0xA6-0xB9 Unassigned */ 193 194 #define VK_BROWSER_BACK 0xA6 195 #define VK_BROWSER_FORWARD 0xA7 196 #define VK_BROWSER_REFRESH 0xA8 197 #define VK_BROWSER_STOP 0xA9 198 #define VK_BROWSER_SEARCH 0xAA 199 #define VK_BROWSER_FAVORITES 0xAB 200 #define VK_BROWSER_HOME 0xAC 201 #define VK_VOLUME_MUTE 0xAD 202 #define VK_VOLUME_DOWN 0xAE 203 #define VK_VOLUME_UP 0xAF 204 #define VK_MEDIA_NEXT_TRACK 0xB0 205 #define VK_MEDIA_PREV_TRACK 0xB1 206 #define VK_MEDIA_STOP 0xB2 207 #define VK_MEDIA_PLAY_PAUSE 0xB3 208 #define VK_LAUNCH_MAIL 0xB4 209 #define VK_LAUNCH_MEDIA_SELECT 0xB5 210 #define VK_LAUNCH_APP1 0xB6 211 #define VK_LAUNCH_APP2 0xB7 212 213 /* 0xB8-0xB9 Unassigned */ 208 214 #define VK_OEM_1 0xBA 209 215 #define VK_OEM_PLUS 0xBB
Note:
See TracChangeset
for help on using the changeset viewer.