Changeset 7455 in vbox
- Timestamp:
- Mar 14, 2008 10:33:04 AM (17 years ago)
- svn:sync-xref-src-repo-rev:
- 28893
- Location:
- trunk/src/VBox/Frontends/VirtualBox4
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified trunk/src/VBox/Frontends/VirtualBox4/include/XKeyboard.h ¶
r5999 r7455 20 20 #define __XKeyboard_h__ 21 21 22 // our structure used to return keyboard event information23 typedef struct _WINEKEYBOARDINFO24 {25 unsigned short wVk;26 unsigned short wScan;27 unsigned long dwFlags;28 unsigned long time;29 } WINEKEYBOARDINFO;30 31 22 // initialize the X keyboard subsystem 32 23 bool initXKeyboard(Display *dpy); 33 24 // our custom keyboard handler 34 void handleXKeyEvent(Display *dpy, XEvent *event, WINEKEYBOARDINFO *wineKbdInfo);25 unsigned handleXKeyEvent(XEvent *event); 35 26 // returns the number of keysyms per keycode (only valid after initXKeyboard()) 36 27 int getKeysymsPerKeycode(); -
TabularUnified trunk/src/VBox/Frontends/VirtualBox4/src/VBoxConsoleView.cpp ¶
r7453 r7455 1883 1883 bool VBoxConsoleView::x11Event (XEvent *event) 1884 1884 { 1885 static WINEKEYBOARDINFO wineKeyboardInfo;1886 1887 1885 switch (event->type) 1888 1886 { … … 1900 1898 break; 1901 1899 /* else fall through */ 1902 /// @todo (AH) later, we might want to handle these as well1903 case KeymapNotify:1904 case MappingNotify:1905 1900 default: 1906 1901 return false; /* pass the event to Qt */ 1907 1902 } 1908 1903 1909 /* perform the mega-complex translation using the wine algorithms*/1910 handleXKeyEvent (QX11Info::display(), event, &wineKeyboardInfo);1904 /* Translate the keycode to a PC scan code. */ 1905 unsigned scan = handleXKeyEvent (event); 1911 1906 1912 1907 #if 0 1913 1908 char buf [256]; 1914 sprintf (buf, "pr=%d kc=%08X st=%08X fl=%08lXscan=%04X",1909 sprintf (buf, "pr=%d kc=%08X st=%08X extended=%s scan=%04X", 1915 1910 event->type == XKeyPress ? 1 : 0, event->xkey.keycode, 1916 event->xkey.state, wineKeyboardInfo.dwFlags, wineKeyboardInfo.wScan);1911 event->xkey.state, scan >> 8 ? "true" : "false", scan & 0x7F); 1917 1912 mMainWnd->statusBar()->message (buf); 1918 1913 LogFlow (("### %s\n", buf)); 1919 1914 #endif 1920 1915 1921 int scan = wineKeyboardInfo.wScan & 0x7F;1922 1916 // scancodes 0x00 (no valid translation) and 0x80 are ignored 1923 if (!scan )1917 if (!scan & 0x7F) 1924 1918 return true; 1925 1919 … … 1927 1921 1928 1922 int flags = 0; 1929 if ( wineKeyboardInfo.dwFlags & 0x0001)1923 if (scan >> 8) 1930 1924 flags |= KeyExtended; 1931 1925 if (event->type == XKeyPress) 1932 1926 flags |= KeyPressed; 1933 1927 1928 /* Remove the extended flag */ 1929 scan &= 0x7F; 1930 1934 1931 switch (ks) 1935 1932 { 1936 case XK_Num_Lock:1937 // Wine sets the extended bit for the NumLock key. Reset it.1938 flags &= ~KeyExtended;1939 break;1940 1933 case XK_Print: 1941 1934 flags |= KeyPrint; -
TabularUnified trunk/src/VBox/Frontends/VirtualBox4/src/linux/XKeyboard-new.cpp ¶
r5999 r7455 158 158 * Translate an X server scancode to a PC keyboard scancode. 159 159 */ 160 void handleXKeyEvent(Display *, XEvent *event, WINEKEYBOARDINFO *wineKbdInfo)160 unsigned handleXKeyEvent(XEvent *event) 161 161 { 162 162 // call the WINE event handler 163 XKeyEvent *keyEvent = &event->xkey; 164 unsigned scan = X11DRV_KeyEvent(keyEvent->keycode); 165 wineKbdInfo->wScan = scan & 0xFF; 166 wineKbdInfo->dwFlags = scan >> 8; 163 return X11DRV_KeyEvent(event->xkey.keycode); 167 164 } 168 165 -
TabularUnified trunk/src/VBox/Frontends/VirtualBox4/src/linux/keyboard-tables.h ¶
r6503 r7455 82 82 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* FF58 */ 83 83 /* misc keys */ 84 /* innotek FIX */85 84 /*?*/ 0, 0x137, /*?*/ 0, 0x152, 0x00, 0x00, 0x00, 0x15D, /* FF60 */ 86 85 /*?*/ 0, /*?*/ 0, 0x38, 0x146, 0x00, 0x00, 0x00, 0x00, /* FF68 */ 87 86 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* FF70 */ 88 87 /* keypad keys */ 89 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x138, 0x 145,/* FF78 */88 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x138, 0x45, /* FF78 */ 90 89 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* FF80 */ 91 90 0x00, 0x00, 0x00, 0x00, 0x00, 0x11C, 0x00, 0x00, /* FF88 */ … … 93 92 0x4D, 0x50, 0x49, 0x51, 0x4F, 0x4C, 0x52, 0x53, /* FF98 */ 94 93 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* FFA0 */ 95 /* innotek FIX */96 94 0x00, 0x00, 0x37, 0x4E, 0x53, 0x4A, 0x7e, 0x135, /* FFA8 */ 97 95 0x52, 0x4F, 0x50, 0x51, 0x4B, 0x4C, 0x4D, 0x47, /* FFB0 */ … … 105 103 /* modifier keys */ 106 104 0x00, 0x2A, 0x36, 0x1D, 0x11D, 0x3A, 0x00, 0x38, /* FFE0 */ 107 /* innotek FIX */108 105 0x138, 0x38, 0x138, 0x15B, 0x15C, 0x00, 0x00, 0x00, /* FFE8 */ 109 106 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* FFF0 */ … … 111 108 }; 112 109 113 /* innotek FIX */114 110 /* This list was put together using /usr/include/X11/XF86keysym.h and 115 111 http://www.win.tue.nl/~aeb/linux/kbd/scancodes-6.html. It has not yet
Note:
See TracChangeset
for help on using the changeset viewer.