Changeset 59657 in vbox
- Timestamp:
- Feb 12, 2016 2:08:05 PM (9 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/runtime
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIKeyboardHandler.cpp
r59656 r59657 1410 1410 , m_fPassCADtoGuest(false) 1411 1411 , m_fDebuggerActive(false) 1412 , m_iKeyboardHookViewIndex(-1) 1412 1413 #if defined(Q_WS_MAC) 1413 , m_iKeyboardHookViewIndex(-1)1414 1414 , m_uDarwinKeyModifiers(0) 1415 1415 #elif defined(Q_WS_WIN) 1416 , m_iKeyboardHookViewIndex(-1)1417 1416 , m_fIsHostkeyInCapture(false) 1418 1417 , m_fSkipKeyboardEvents(false) … … 1481 1480 UICocoaApplication::instance()->unregisterForNativeEvents(RT_BIT_32(10) | RT_BIT_32(11) | RT_BIT_32(12) /* NSKeyDown | NSKeyUp | | NSFlagsChanged */, 1482 1481 UIKeyboardHandler::macKeyboardProc, this); 1483 /* Update the id: */1484 m_iKeyboardHookViewIndex = -1;1485 1482 } 1486 1483 … … 1491 1488 m_pAltGrMonitor = 0; 1492 1489 1493 /* Cleanup keyboard-hook: */1490 /* If keyboard-hook is installed: */ 1494 1491 if (m_keyboardHook) 1495 1492 { 1496 1493 /* Uninstall existing keyboard-hook: */ 1497 ::UnhookWindowsHookEx(m_keyboardHook); 1498 m_keyboardHook = NULL; 1499 /* Update the id: */ 1500 m_iKeyboardHookViewIndex = -1; 1494 UnhookWindowsHookEx(m_keyboardHook); 1495 m_keyboardHook = 0; 1501 1496 } 1502 1497 1503 1498 #endif /* Q_WS_WIN */ 1499 1500 /* Update keyboard hook view index: */ 1501 m_iKeyboardHookViewIndex = -1; 1504 1502 } 1505 1503 … … 1565 1563 ::DarwinGrabKeyboard(false); 1566 1564 } 1567 /* Update the id: */1568 m_iKeyboardHookViewIndex = uScreenId;1569 1565 } 1570 1566 … … 1585 1581 m_keyboardHook = SetWindowsHookEx(WH_KEYBOARD_LL, UIKeyboardHandler::winKeyboardProc, GetModuleHandle(NULL), 0); 1586 1582 AssertMsg(m_keyboardHook, ("SetWindowsHookEx(): err=%d", GetLastError())); 1587 /* Update the id: */1588 m_iKeyboardHookViewIndex = uScreenId;1589 1583 } 1590 1584 1591 1585 #endif /* Q_WS_WIN */ 1586 1587 /* Update keyboard hook view index: */ 1588 m_iKeyboardHookViewIndex = uScreenId; 1592 1589 1593 1590 if (isSessionRunning()) … … 1605 1602 setAutoCaptureDisabled(false); 1606 1603 } 1604 1607 1605 break; 1608 1606 } … … 1618 1616 UICocoaApplication::instance()->unregisterForNativeEvents(RT_BIT_32(10) | RT_BIT_32(11) | RT_BIT_32(12) /* NSKeyDown | NSKeyUp | | NSFlagsChanged */, 1619 1617 UIKeyboardHandler::macKeyboardProc, this); 1620 /* Update the id: */1621 m_iKeyboardHookViewIndex = -1;1622 1618 } 1623 1619 … … 1630 1626 UnhookWindowsHookEx(m_keyboardHook); 1631 1627 m_keyboardHook = 0; 1632 /* Update the id: */1633 m_iKeyboardHookViewIndex = -1;1634 1628 } 1635 1629 1636 1630 #endif /* Q_WS_WIN */ 1631 1632 /* Update keyboard hook view index: */ 1633 m_iKeyboardHookViewIndex = -1; 1637 1634 1638 1635 /* Release keyboard: */ … … 1641 1638 /* And all pressed keys: */ 1642 1639 releaseAllPressedKeys(true); 1640 1643 1641 break; 1644 1642 } … … 1680 1678 popupCenter().remindAboutPausedVMInput(machineLogic()->activeMachineWindow()); 1681 1679 } 1680 1682 1681 break; 1683 1682 } -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIKeyboardHandler.h
r59656 r59657 212 212 bool m_fDebuggerActive : 1; 213 213 214 #if defined(Q_WS_MAC)215 214 /** Holds the keyboard hook view index. */ 216 215 int m_iKeyboardHookViewIndex; 217 /** Holds the current modifiers key mask. */ 216 217 #if defined(Q_WS_MAC) 218 /** Mac: Holds the current modifiers key mask. */ 218 219 UInt32 m_uDarwinKeyModifiers; 219 220 #elif defined(Q_WS_WIN) 220 /** Holds the keyboard hook view index. */ 221 int m_iKeyboardHookViewIndex; 222 /* Currently this is used in winKeyboardEvent() only: */ 221 /** Win: Currently this is used in winKeyboardEvent() only. */ 223 222 bool m_fIsHostkeyInCapture; 224 /** Holds whether the keyboard event filter should ignore keyboard events. */223 /** Win: Holds whether the keyboard event filter should ignore keyboard events. */ 225 224 bool m_fSkipKeyboardEvents; 226 /** Holds the keyboard hook instance. */225 /** Win: Holds the keyboard hook instance. */ 227 226 HHOOK m_keyboardHook; 228 /** Holds the object monitoring key event stream for problematic AltGr events. */227 /** Win: Holds the object monitoring key event stream for problematic AltGr events. */ 229 228 WinAltGrMonitor *m_pAltGrMonitor; 230 /** Holds the keyboard handler reference to be accessible from the keyboard hook. */229 /** Win: Holds the keyboard handler reference to be accessible from the keyboard hook. */ 231 230 static UIKeyboardHandler *m_spKeyboardHandler; 232 231 #endif /* Q_WS_WIN */
Note:
See TracChangeset
for help on using the changeset viewer.