Changeset 35864 in vbox
- Timestamp:
- Feb 7, 2011 11:35:09 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIKeyboardHandler.cpp
r35744 r35864 1112 1112 1113 1113 /* Update the map of pressed host-combo keys: */ 1114 if ( fFlags & KeyPressed)1115 { 1116 if ( allHostComboKeys.contains(iKey))1114 if (allHostComboKeys.contains(iKey)) 1115 { 1116 if (fFlags & KeyPressed) 1117 1117 { 1118 1118 if (!m_pressedHostComboKeys.contains(iKey)) … … 1121 1121 return true; 1122 1122 } 1123 }1124 else1125 {1126 if (allHostComboKeys.contains(iKey) && m_pressedHostComboKeys.contains(iKey))1127 m_pressedHostComboKeys.remove(iKey);1123 else 1124 { 1125 if (m_pressedHostComboKeys.contains(iKey)) 1126 m_pressedHostComboKeys.remove(iKey); 1127 } 1128 1128 } 1129 1129 /* Check if we are currently holding FULL host-combo: */ … … 1161 1161 } 1162 1162 1163 /* Prepare empty code-buffer: */ 1163 /* Preparing the press/release scan-codes array for sending to the guest: 1164 * 1. if host-combo is NOT pressed, taking into account currently pressed key too, 1165 * 2. if currently released key releases host-combo too. 1166 * Using that rule, we are NOT sending to the guest: 1167 * 1. the last key-press of host-combo, 1168 * 2. all keys pressed while the host-combo being held. */ 1164 1169 LONG aCodesBuffer[16]; 1165 1170 LONG *pCodes = aCodesBuffer; 1166 1171 uint uCodesCount = 0; 1167 /* Processing usual key-presses/releases without host-key being held: */1168 if (!m_bIsHostComboPressed ||isHostComboStateChanged)1172 if (!m_bIsHostComboPressed && !isHostComboStateChanged || 1173 m_bIsHostComboPressed && isHostComboStateChanged) 1169 1174 { 1170 1175 /* Special flags handling (KeyPrint): */ … … 1341 1346 emit keyboardStateChanged(keyboardState()); 1342 1347 1343 /* If the VM is NOT paused and there are scancodes to send: */1344 if (!uisession()->isPaused() && uCodesCount)1345 { 1346 /* Get the VM keyboard to pass key in there: */1348 /* If the VM is NOT paused: */ 1349 if (!uisession()->isPaused()) 1350 { 1351 /* Get the VM keyboard: */ 1347 1352 CKeyboard keyboard = session().GetConsole().GetKeyboard(); 1348 1353 Assert(!keyboard.isNull()); 1349 1354 1350 /* Pass this key to the guest: */ 1351 std::vector<LONG> scancodes(pCodes, &pCodes[uCodesCount]); 1352 keyboard.PutScancodes(QVector<LONG>::fromStdVector(scancodes)); 1353 1354 /* If full host-key sequence was just finalized 1355 * and the last key of host-combination was just sent to the guest => 1356 * we have to notify guest to make it release keys from the host-combination: */ 1355 /* If there are scan-codes to send: */ 1356 if (uCodesCount) 1357 { 1358 /* Send prepared scan-codes to the guest: */ 1359 std::vector<LONG> scancodes(pCodes, &pCodes[uCodesCount]); 1360 keyboard.PutScancodes(QVector<LONG>::fromStdVector(scancodes)); 1361 } 1362 1363 /* If full host-key sequence was just finalized: */ 1357 1364 if (isHostComboStateChanged && m_bIsHostComboPressed) 1358 1365 { 1366 /* We have to make guest to release pressed keys from the host-combination: */ 1359 1367 QList<uint8_t> hostComboScans = m_pressedHostComboKeys.values(); 1360 1368 for (int i = 0 ; i < hostComboScans.size(); ++i)
Note:
See TracChangeset
for help on using the changeset viewer.

