Changeset 6767 in vbox
- Timestamp:
- Feb 3, 2008 5:39:44 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/VBoxConsoleView.cpp
r6721 r6767 1035 1035 else 1036 1036 { 1037 /* release the host key even when paused */ 1038 mIsHostkeyPressed = false; 1039 emitKeyboardStateChanged(); 1037 /* release the host key and all other pressed keys too even 1038 * when paused (otherwise, we will get stuck keys in the 1039 * guest when doing sendChangedKeyStates() on resume because 1040 * key presses were already recorded in mPressedKeys but key 1041 * releases will most likely not reach us but the new focus 1042 * window instead). */ 1043 releaseAllPressedKeys (true /* aReleaseHostKey */); 1040 1044 } 1041 1045 break; … … 1279 1283 1280 1284 case QEvent::KeyPress: 1285 case QEvent::KeyRelease: 1286 { 1287 QKeyEvent *ke = (QKeyEvent *) e; 1288 1281 1289 #ifdef Q_WS_PM 1282 case QEvent::KeyRelease:1283 {1284 1290 /// @todo temporary solution to send Alt+Tab and friends to 1285 1291 // the guest. The proper solution is to write a keyboard … … 1287 1293 // impossible to do so using hooks on OS/2). 1288 1294 1289 QKeyEvent *ke = (QKeyEvent *) e;1290 1295 if (mIsHostkeyPressed) 1291 1296 { … … 1359 1364 } 1360 1365 } 1361 if (e->type() == QEvent::KeyRelease) 1362 break; 1363 1364 /* fall through for normal processing of KeyPress */ 1365 #else 1366 { 1367 QKeyEvent *ke = (QKeyEvent *) e; 1368 #endif 1369 if (mIsHostkeyPressed) 1366 1367 /* fall through to normal processing */ 1368 1369 #endif /* Q_WS_PM */ 1370 1371 if (mIsHostkeyPressed && e->type() == QEvent::KeyPress) 1370 1372 { 1371 1373 if (ke->key() >= Key_F1 && ke->key() <= Key_F12) … … 1409 1411 } 1410 1412 } 1411 else 1413 else if (!mIsHostkeyPressed && e->type() == QEvent::KeyRelease) 1412 1414 { 1415 /* Show a possible warning on key release which seems to 1416 * be more expected by the end user */ 1417 1413 1418 if (isPaused()) 1414 1419 { … … 1420 1425 } 1421 1426 } 1427 1422 1428 ke->accept(); 1423 1429 return true; … … 2957 2963 2958 2964 #ifdef Q_WS_MAC 2959 ::DarwinUpdateDockPreview (DarwinQPixmapToCGImage (&mPausedShot), 2960 mVirtualBoxLogo, 2965 ::DarwinUpdateDockPreview (DarwinQPixmapToCGImage (&mPausedShot), 2966 mVirtualBoxLogo, 2961 2967 mMainWnd->dockImageState()); 2962 2968 #endif … … 3136 3142 * @param aReleaseHostKey @c true to set the host key state to unpressed. 3137 3143 */ 3138 void VBoxConsoleView::releaseAllPressedKeys (bool aReleaseHostKey )3144 void VBoxConsoleView::releaseAllPressedKeys (bool aReleaseHostKey /* = true*/) 3139 3145 { 3140 3146 AssertMsg (mAttached, ("Console must be attached"));
Note:
See TracChangeset
for help on using the changeset viewer.