Changeset 63609 in vbox
- Timestamp:
- Aug 22, 2016 2:10:44 PM (9 years ago)
- svn:sync-xref-src-repo-rev:
- 110319
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/runtime
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIKeyboardHandler.cpp
r63608 r63609 40 40 # include <QX11Info> 41 41 # endif 42 # if !defined(VBOX_WS_MAC) &&QT_VERSION >= 0x05000042 # if QT_VERSION >= 0x050000 43 43 # include <QTimer> 44 44 # endif … … 266 266 * a low-level keyboard-hook is used instead. 267 267 * It is being installed on focus-in event and uninstalled on focus-out. 268 * S.a. UIKeyboardHandler::eventFilter for more information. */269 270 /* On Mac, we also271 * use the Qt method to grab the keyboard,272 * disable global hot keys and273 * enable watching modifiers (for right/left separation). */274 /// @todo Is that really needed? 275 ::DarwinDisableGlobalHotKeys(true);276 m_views[uScreenId]->grabKeyboard();268 * S.a. UIKeyboardHandler::eventFilter for more information. 269 * 270 * Besides that, we do not grab the keyboard as soon as it is captured, 271 * but delay it for 300 milliseconds after the formal capture. 272 * We do it mainly to have the common behavior under all 273 * hosts and X11 is forced to behave that way. */ 274 275 /* Delay finalising capture for 300 milliseconds: */ 276 QTimer::singleShot(300, this, SLOT(sltFinaliseCaptureKeyboard())); 277 277 278 278 #elif defined(VBOX_WS_WIN) … … 360 360 m_iKeyboardCaptureViewIndex = uScreenId; 361 361 362 #if defined(VBOX_WS_MAC) ||QT_VERSION < 0x050000362 #if QT_VERSION < 0x050000 363 363 /* Finalise keyboard capture: */ 364 364 finaliseCaptureKeyboard(); … … 380 380 if (m_views.contains(m_iKeyboardCaptureViewIndex)) 381 381 { 382 #if defined(VBOX_WS_X11) && QT_VERSION >= 0x050000 382 #if defined(VBOX_WS_MAC) 383 384 /* On Mac, we are not just using the Qt stuff to grab the keyboard, 385 * we also disable global hot keys and enable watching 386 * modifiers (for right/left separation). */ 387 388 /// @todo Is that really needed? 389 ::DarwinDisableGlobalHotKeys(true); 390 m_views[m_iKeyboardCaptureViewIndex]->grabKeyboard(); 391 392 #elif defined(VBOX_WS_X11) && QT_VERSION >= 0x050000 383 393 384 394 /* On X11, we are using XCB stuff to grab the keyboard. … … 1517 1527 } 1518 1528 1519 #if !defined(VBOX_WS_MAC) &&QT_VERSION >= 0x0500001529 #if QT_VERSION >= 0x050000 1520 1530 void UIKeyboardHandler::sltFinaliseCaptureKeyboard() 1521 1531 { -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIKeyboardHandler.h
r63608 r63609 20 20 21 21 /* Qt includes: */ 22 #include <QtGlobal> 22 23 #include <QMap> 23 24 #include <QObject> … … 133 134 virtual void sltMachineStateChanged(); 134 135 135 #if !defined(VBOX_WS_MAC) &&QT_VERSION >= 0x050000136 #if QT_VERSION >= 0x050000 136 137 /** Finalises keyboard capture. */ 137 138 void sltFinaliseCaptureKeyboard();
Note:
See TracChangeset
for help on using the changeset viewer.