Changeset 53079 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Oct 16, 2014 2:49:09 PM (10 years ago)
- svn:sync-xref-src-repo-rev:
- 96591
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/runtime
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIKeyboardHandler.cpp
r52730 r53079 297 297 void UIKeyboardHandler::releaseAllPressedKeys(bool aReleaseHostKey /* = true */) 298 298 { 299 CKeyboard keyboard = session().GetConsole().GetKeyboard();300 299 bool fSentRESEND = false; 301 300 … … 311 310 if (!fSentRESEND) 312 311 { 313 keyboard .PutScancode(0xFE);312 keyboard().PutScancode(0xFE); 314 313 fSentRESEND = true; 315 314 } 316 keyboard .PutScancode(i | 0x80);315 keyboard().PutScancode(i | 0x80); 317 316 } 318 317 else if (m_pressedKeys[i] & IsExtKeyPressed) … … 320 319 if (!fSentRESEND) 321 320 { 322 keyboard .PutScancode(0xFE);321 keyboard().PutScancode(0xFE); 323 322 fSentRESEND = true; 324 323 } … … 326 325 codes[0] = 0xE0; 327 326 codes[1] = i | 0x80; 328 keyboard .PutScancodes(codes);327 keyboard().PutScancodes(codes); 329 328 } 330 329 m_pressedKeys[i] = 0; … … 869 868 } 870 869 871 /* Main Session getter: */ 872 CSession& UIKeyboardHandler::session() const 873 { 874 return uisession()->session(); 870 CKeyboard& UIKeyboardHandler::keyboard() const 871 { 872 return uisession()->keyboard(); 875 873 } 876 874 … … 1022 1020 combo[3] = 0xd7 + (pKeyEvent->key() - Qt::Key_F11); /* F11-F12 up */ 1023 1021 } 1024 CKeyboard keyboard = session().GetConsole().GetKeyboard(); 1025 keyboard.PutScancodes(combo); 1022 keyboard().PutScancodes(combo); 1026 1023 } 1027 1024 /* Process hot keys not processed in keyEvent() (as in case of non-alphanumeric keys): */ … … 1564 1561 if (!uisession()->isPaused()) 1565 1562 { 1566 /* Get the VM keyboard: */1567 CKeyboard keyboard = session().GetConsole().GetKeyboard();1568 Assert(!keyboard.isNull());1569 1570 1563 /* If there are scan-codes to send: */ 1571 1564 if (uCodesCount) … … 1573 1566 /* Send prepared scan-codes to the guest: */ 1574 1567 std::vector<LONG> scancodes(pCodes, &pCodes[uCodesCount]); 1575 keyboard .PutScancodes(QVector<LONG>::fromStdVector(scancodes));1568 keyboard().PutScancodes(QVector<LONG>::fromStdVector(scancodes)); 1576 1569 } 1577 1570 … … 1579 1572 if (isHostComboStateChanged && m_bIsHostComboPressed) 1580 1573 { 1581 keyEventReleaseHostComboKeys(keyboard );1574 keyEventReleaseHostComboKeys(keyboard()); 1582 1575 } 1583 1576 } … … 1730 1723 { 1731 1724 QVector <LONG> codes(2); 1732 CKeyboard keyboard = session().GetConsole().GetKeyboard();1733 1725 for (uint i = 0; i < SIZEOF_ARRAY(m_pressedKeys); ++ i) 1734 1726 { … … 1740 1732 if (!(ns & IsKeyPressed)) 1741 1733 codes[0] |= 0x80; 1742 keyboard .PutScancode(codes[0]);1734 keyboard().PutScancode(codes[0]); 1743 1735 } 1744 1736 else if ((os & IsExtKeyPressed) != (ns & IsExtKeyPressed)) … … 1748 1740 if (!(ns & IsExtKeyPressed)) 1749 1741 codes[1] |= 0x80; 1750 keyboard .PutScancodes(codes);1742 keyboard().PutScancodes(codes); 1751 1743 } 1752 1744 } -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIKeyboardHandler.h
r52925 r53079 35 35 /* Forward declarations: */ 36 36 class QWidget; 37 class CSession;38 37 class UISession; 39 38 class UIActionPool; … … 45 44 typedef union _XEvent XEvent; 46 45 #endif /* Q_WS_X11 */ 46 class CKeyboard; 47 47 48 48 /* Delegate to control VM keyboard functionality: */ … … 117 117 UIActionPool* actionPool() const; 118 118 UISession* uisession() const; 119 CSession& session() const; 119 120 /** Returns the console's keyboard reference. */ 121 CKeyboard& keyboard() const; 120 122 121 123 /* Event handler for registered machine-view(s): */ -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMouseHandler.cpp
r52978 r53079 206 206 207 207 /* Switch guest mouse to the relative mode: */ 208 CMouse mouse = session().GetConsole().GetMouse(); 209 mouse.PutMouseEvent(0, 0, 0, 0, 0); 208 mouse().PutMouseEvent(0, 0, 0, 0, 0); 210 209 211 210 /* Notify all the listeners: */ … … 338 337 releaseMouse(); 339 338 /* Also we should switch guest mouse to the absolute mode: */ 340 CMouse mouse = session().GetConsole().GetMouse(); 341 mouse.PutMouseEventAbsolute(-1, -1, 0, 0, 0); 339 mouse().PutMouseEventAbsolute(-1, -1, 0, 0, 0); 342 340 } 343 341 #if 0 /* current team's decision is NOT to capture mouse on mouse-absolute mode loosing! */ … … 368 366 { 369 367 /* Switch guest mouse to the relative mode: */ 370 CMouse mouse = session().GetConsole().GetMouse(); 371 mouse.PutMouseEvent(0, 0, 0, 0, 0); 368 mouse().PutMouseEvent(0, 0, 0, 0, 0); 372 369 } 373 370 #endif … … 488 485 } 489 486 490 /* Main Session getter: */ 491 CSession& UIMouseHandler::session() const 492 { 493 return uisession()->session(); 487 CDisplay& UIMouseHandler::display() const 488 { 489 return uisession()->display(); 490 } 491 492 CMouse& UIMouseHandler::mouse() const 493 { 494 return uisession()->mouse(); 494 495 } 495 496 … … 842 843 ::UpdateWindow(m_viewports[uScreenId]->winId()); 843 844 #endif 844 CMouse mouse = session().GetConsole().GetMouse(); 845 mouse.PutMouseEvent(globalPos.x() - m_lastMousePos.x(), 846 globalPos.y() - m_lastMousePos.y(), 847 iWheelVertical, iWheelHorizontal, iMouseButtonsState); 845 mouse().PutMouseEvent(globalPos.x() - m_lastMousePos.x(), 846 globalPos.y() - m_lastMousePos.y(), 847 iWheelVertical, iWheelHorizontal, iMouseButtonsState); 848 848 849 849 #ifdef Q_WS_WIN … … 963 963 ULONG dummy; 964 964 KGuestMonitorStatus monitorStatus = KGuestMonitorStatus_Enabled; 965 session().GetConsole().GetDisplay().GetScreenResolution(uScreenId, dummy, dummy, dummy, xShift, yShift, monitorStatus);965 display().GetScreenResolution(uScreenId, dummy, dummy, dummy, xShift, yShift, monitorStatus); 966 966 /* Set shifting: */ 967 967 cpnt.setX(cpnt.x() + xShift); … … 969 969 970 970 /* Post absolute mouse-event into guest: */ 971 CMouse mouse = session().GetConsole().GetMouse(); 972 mouse.PutMouseEventAbsolute(cpnt.x() + 1, cpnt.y() + 1, iWheelVertical, iWheelHorizontal, iMouseButtonsState); 971 mouse().PutMouseEventAbsolute(cpnt.x() + 1, cpnt.y() + 1, iWheelVertical, iWheelHorizontal, iMouseButtonsState); 973 972 return true; 974 973 } … … 1021 1020 return true; 1022 1021 1023 /* Get mouse: */1024 CMouse mouse = session().GetConsole().GetMouse();1025 1026 1022 QVector<LONG64> contacts(pTouchEvent->touchPoints().size()); 1027 1023 … … 1029 1025 ULONG dummy; 1030 1026 KGuestMonitorStatus monitorStatus = KGuestMonitorStatus_Enabled; 1031 session().GetConsole().GetDisplay().GetScreenResolution(uScreenId, dummy, dummy, dummy, xShift, yShift, monitorStatus);1027 display().GetScreenResolution(uScreenId, dummy, dummy, dummy, xShift, yShift, monitorStatus); 1032 1028 1033 1029 /* Pass all multi-touch events into guest: */ … … 1065 1061 } 1066 1062 1067 mouse .PutEventMultiTouch(pTouchEvent->touchPoints().size(),1068 contacts,1069 (ULONG)RTTimeMilliTS());1063 mouse().PutEventMultiTouch(pTouchEvent->touchPoints().size(), 1064 contacts, 1065 (ULONG)RTTimeMilliTS()); 1070 1066 1071 1067 /* Eat by default? */ -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMouseHandler.h
r52727 r53079 38 38 typedef union _XEvent XEvent; 39 39 #endif /* Q_WS_X11 */ 40 class CSession; 40 class CDisplay; 41 class CMouse; 41 42 42 43 /* Delegate to control VM mouse functionality: */ … … 97 98 UIMachineLogic* machineLogic() const; 98 99 UISession* uisession() const; 99 CSession& session() const; 100 101 /** Returns the console's display reference. */ 102 CDisplay& display() const; 103 /** Returns the console's mouse reference. */ 104 CMouse& mouse() const; 100 105 101 106 /* Event handler for registered machine-view(s): */
Note:
See TracChangeset
for help on using the changeset viewer.