Changeset 2378 in vbox
- Timestamp:
- Apr 27, 2007 2:49:26 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/VBoxConsoleView.cpp
r2348 r2378 699 699 vboxProblem().cannotResumeMachine (cconsole); 700 700 } 701 #ifdef Q_WS_MAC /* A quick hack to prevent getting the typing-while-paused on Host-Q. */702 else if (on)703 darwinGrabKeyboardEvents (false);704 #endif705 701 706 702 return ok; … … 1406 1402 AssertCompileSize (wchar_t, 2); 1407 1403 AssertCompileSize (UniChar, 2); 1408 wchar_t ucs[32]; 1404 UInt32 cbWritten = 0; 1405 wchar_t ucs[8]; 1409 1406 if (::GetEventParameter (inEvent, kEventParamKeyUnicodes, typeUnicodeText, NULL, 1410 sizeof (ucs), NULL, &ucs[0]) != 0) 1411 ucs[0] = 0; 1407 sizeof (ucs), &cbWritten, &ucs[0]) != 0) 1408 cbWritten = 0; 1409 ucs[cbWritten / sizeof(wchar_t)] = 0; /* The api doesn't terminate it. */ 1412 1410 1413 1411 ret = keyEvent (keyCode, scanCode, flags, ucs[0] ? ucs : NULL); … … 1422 1420 newMask = ::DarwinAdjustModifierMask (newMask); 1423 1421 UInt32 changed = newMask ^ m_darwinKeyModifiers; 1424 ret = kbd_captured;1425 1422 if (changed) 1426 1423 { … … 1449 1446 flags |= KeyExtended; 1450 1447 scanCode &= VBOXKEY_SCANCODE_MASK; 1451 ret |=keyEvent (keyCode, scanCode, flags | KeyPressed);1452 ret |=keyEvent (keyCode, scanCode, flags);1448 keyEvent (keyCode, scanCode, flags | KeyPressed); 1449 keyEvent (keyCode, scanCode, flags); 1453 1450 } 1454 1451 } … … 1456 1453 1457 1454 m_darwinKeyModifiers = newMask; 1455 1456 /* Always return true here because we'll otherwise getting a Qt event 1457 we don't want and that will only cause the Pause warning to pop up. */ 1458 ret = true; 1458 1459 } 1459 1460 … … 1666 1667 LONG *codes = buf; 1667 1668 uint count = 0; 1669 uint8_t what_pressed = 0; 1668 1670 1669 1671 if (!is_hostkey) … … 1701 1703 1702 1704 // process the scancode and update the table of pressed keys 1703 uint8_twhat_pressed = IsKeyPressed;1705 what_pressed = IsKeyPressed; 1704 1706 1705 1707 if (flags & KeyExtended) … … 1846 1848 } 1847 1849 #elif defined (Q_WS_MAC) 1848 if (aUniKey && aUniKey [0] && !aUniKey[1])1850 if (aUniKey && aUniKey [0] && !aUniKey [1]) 1849 1851 processed = processHotKey (QKeySequence (UNICODE_ACCEL + 1850 QChar (aUniKey [0]).upper().unicode()),1852 QChar (aUniKey [0]).upper().unicode()), 1851 1853 mainwnd->menuBar()); 1852 #endif 1854 1855 /* Don't consider the hot key as pressed since the guest never saw it. (probably a generic thing) */ 1856 keys_pressed [scan] &= ~what_pressed; 1857 #endif 1858 1853 1859 // grab the key from Qt if processed, or pass it to Qt otherwise 1854 1860 // in order to process non-alphanumeric keys in event(), after they are … … 1874 1880 1875 1881 // LogFlow (("*** Putting scan codes: ")); 1876 // for ( inti = 0; i < count; i++)1882 // for (unsigned i = 0; i < count; i++) 1877 1883 // LogFlow (("%02x ", codes [i])); 1878 1884 // LogFlow (("\n")); … … 2280 2286 if (capture) 2281 2287 { 2282 # if 02283 ::DarwinReleaseKeyboard ();2284 ::DarwinGrabKeyboard (true);2285 # else2286 2288 ::DarwinDisableGlobalHotKeys (true); 2287 # endif2288 2289 grabKeyboard(); 2289 2290 } 2290 2291 else 2291 2292 { 2292 # if 02293 ::DarwinReleaseKeyboard ();2294 ::DarwinGrabKeyboard (false);2295 # else2296 2293 ::DarwinDisableGlobalHotKeys (false); 2297 # endif2298 2294 releaseKeyboard(); 2299 2295 } … … 2427 2423 // Note, that it's just a guess that sending RESEND will give the desired 2428 2424 // effect :), but at least it works with NT and W2k guests. 2425 /** @todo This seems to causes linux guests (in console mode) to cough a bit. 2426 * We need to check if this is the cause of #1944 and/or #1949. --bird */ 2429 2427 codes [0] = 0xFE; 2430 2428 keyboard.PutScancodes (codes, 1); … … 2445 2443 if (release_hostkey) 2446 2444 hostkey_pressed = false; 2445 2446 #ifdef Q_WS_MAC 2447 /* clear most of the modifiers. */ 2448 m_darwinKeyModifiers &= alphaLock | kEventKeyModifierNumLockMask 2449 | (release_hostkey ? 0 : ::DarwinKeyCodeToDarwinModifierMask (gs.hostKey())); 2450 #endif 2447 2451 2448 2452 emitKeyboardStateChanged ();
Note:
See TracChangeset
for help on using the changeset viewer.