Changeset 73841 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Aug 22, 2018 5:13:17 PM (6 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataDefs.h
r72030 r73841 513 513 RuntimeMenuInputActionType_Mouse = RT_BIT(8), 514 514 RuntimeMenuInputActionType_MouseIntegration = RT_BIT(9), 515 RuntimeMenuInputActionType_TypeHostKeyCombo = RT_BIT(10), 515 516 RuntimeMenuInputActionType_All = 0xFFFF 516 517 }; -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIActionPoolRuntime.cpp
r73791 r73841 1813 1813 setName(QApplication::translate("UIActionPool", "&Insert %1", "that means send the %1 key sequence to the virtual machine").arg("Alt Print Screen")); 1814 1814 setStatusTip(QApplication::translate("UIActionPool", "Send the %1 sequence to the virtual machine").arg("Alt Print Screen")); 1815 } 1816 }; 1817 1818 /** Toggle action extension, used as 'Perform Host Key Combo press/release' action class. */ 1819 class UIActionToggleRuntimePerformTypeHostKeyCombo : public UIActionToggle 1820 { 1821 Q_OBJECT; 1822 1823 public: 1824 1825 /** Constructs action passing @a pParent to the base-class. */ 1826 UIActionToggleRuntimePerformTypeHostKeyCombo(UIActionPool *pParent) 1827 : UIActionToggle 1828 (pParent, 1829 ":/vm_pause_on_16px.png", ":/vm_pause_16px.png", 1830 ":/vm_pause_on_disabled_16px.png", ":/vm_pause_disabled_16px.png", 1831 true) 1832 {} 1833 1834 protected: 1835 1836 /** Returns action extra-data ID. */ 1837 virtual int extraDataID() const /* override */ 1838 { 1839 return UIExtraDataMetaDefs::RuntimeMenuInputActionType_TypeHostKeyCombo; 1840 } 1841 /** Returns action extra-data key. */ 1842 virtual QString extraDataKey() const /* override */ 1843 { 1844 return gpConverter->toInternalString(UIExtraDataMetaDefs::RuntimeMenuInputActionType_TypeHostKeyCombo); 1845 } 1846 /** Returns whether action is allowed. */ 1847 virtual bool isAllowed() const /* override */ 1848 { 1849 return actionPool()->toRuntime()->isAllowedInMenuInput(UIExtraDataMetaDefs::RuntimeMenuInputActionType_TypeHostKeyCombo); 1850 } 1851 1852 /** Returns shortcut extra-data ID. */ 1853 virtual QString shortcutExtraDataID() const /* override */ 1854 { 1855 return QString("TypeHostKeyCode"); 1856 } 1857 1858 /** Returns default shortcut. */ 1859 virtual QKeySequence defaultShortcut(UIActionPoolType) const /* override */ 1860 { 1861 #ifdef VBOX_WS_MAC 1862 return QKeySequence("Insert"); 1863 #else 1864 return QKeySequence("Insert"); 1865 #endif 1866 } 1867 1868 /** Handles translation event. */ 1869 virtual void retranslateUi() /* override */ 1870 { 1871 setName(QApplication::translate("UIActionPool", "&Insert %1", "that means send the %1 key sequence to the virtual machine").arg("Home Key Combo")); 1872 setStatusTip(QApplication::translate("UIActionPool", "Send the %1 sequence to the virtual machine").arg("Home Key Combo")); 1815 1873 } 1816 1874 }; … … 3212 3270 m_pool[UIActionIndexRT_M_Input_M_Keyboard_S_TypePrintScreen] = new UIActionSimpleRuntimePerformTypePrintScreen(this); 3213 3271 m_pool[UIActionIndexRT_M_Input_M_Keyboard_S_TypeAltPrintScreen] = new UIActionSimpleRuntimePerformTypeAltPrintScreen(this); 3272 m_pool[UIActionIndexRT_M_Input_M_Keyboard_T_TypeHostKeyCombo] = new UIActionToggleRuntimePerformTypeHostKeyCombo(this); 3214 3273 m_pool[UIActionIndexRT_M_Input_M_Mouse] = new UIActionMenuRuntimeMouse(this); 3215 3274 m_pool[UIActionIndexRT_M_Input_M_Mouse_T_Integration] = new UIActionToggleRuntimeMouseIntegration(this); … … 3975 4034 /* 'Type Alt Print Screen' action: */ 3976 4035 fSeparator = addAction(pMenu, action(UIActionIndexRT_M_Input_M_Keyboard_S_TypeAltPrintScreen)) || fSeparator; 4036 fSeparator = addAction(pMenu, action(UIActionIndexRT_M_Input_M_Keyboard_T_TypeHostKeyCombo)) || fSeparator; 3977 4037 3978 4038 /* Mark menu as valid: */ -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIActionPoolRuntime.h
r73384 r73841 91 91 UIActionIndexRT_M_Input_M_Keyboard_S_TypePrintScreen, 92 92 UIActionIndexRT_M_Input_M_Keyboard_S_TypeAltPrintScreen, 93 UIActionIndexRT_M_Input_M_Keyboard_T_TypeHostKeyCombo, 93 94 UIActionIndexRT_M_Input_M_Mouse, 94 95 UIActionIndexRT_M_Input_M_Mouse_T_Integration, … … 327 328 328 329 #endif /* !___UIActionPoolRuntime_h___ */ 329 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp
r73694 r73841 41 41 # include "UIDownloaderAdditions.h" 42 42 # endif /* VBOX_GUI_WITH_NETWORK_MANAGER */ 43 # include "UIHostComboEditor.h" 43 44 # include "UIIconPool.h" 44 45 # include "UIKeyboardHandler.h" … … 1030 1031 m_pRunningActions->addAction(actionPool()->action(UIActionIndexRT_M_Input_M_Keyboard_S_TypePrintScreen)); 1031 1032 m_pRunningActions->addAction(actionPool()->action(UIActionIndexRT_M_Input_M_Keyboard_S_TypeAltPrintScreen)); 1033 m_pRunningActions->addAction(actionPool()->action(UIActionIndexRT_M_Input_M_Keyboard_T_TypeHostKeyCombo)); 1032 1034 1033 1035 /* Move actions into running-n-paused actions group: */ … … 1149 1151 connect(actionPool()->action(UIActionIndexRT_M_Input_M_Keyboard_S_TypeAltPrintScreen), SIGNAL(triggered()), 1150 1152 this, SLOT(sltTypeAltPrintScreen())); 1153 connect(actionPool()->action(UIActionIndexRT_M_Input_M_Keyboard_T_TypeHostKeyCombo), SIGNAL(toggled(bool)), 1154 this, SLOT(sltTypeHostKeyComboPressRelease(bool))); 1151 1155 connect(actionPool()->action(UIActionIndexRT_M_Input_M_Mouse_T_Integration), SIGNAL(toggled(bool)), 1152 1156 this, SLOT(sltToggleMouseIntegration(bool))); … … 1677 1681 } 1678 1682 1683 void UIMachineLogic::sltTypeHostKeyComboPressRelease(bool actionToggle) 1684 { 1685 QList<unsigned> shortCodes = UIHostCombo::modifiersToScanCodes(gEDataManager->hostKeyCombination()); 1686 QVector <LONG> codes; 1687 foreach (unsigned idxCode, shortCodes) 1688 { 1689 /* Check if we need to include extend code for this key: */ 1690 if (idxCode & 0x100) 1691 codes << 0xE0; 1692 if (actionToggle) 1693 { 1694 /* Add the press code: */ 1695 codes << (idxCode & 0x7F); 1696 } 1697 else 1698 { 1699 /* Add the release code: */ 1700 codes << ((idxCode & 0x7F) | 0x80); 1701 } 1702 } 1703 1704 keyboard().PutScancodes(codes); 1705 AssertWrapperOk(keyboard()); 1706 } 1707 1679 1708 void UIMachineLogic::sltTakeSnapshot() 1680 1709 { -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.h
r70831 r73841 269 269 void sltTypePrintScreen(); 270 270 void sltTypeAltPrintScreen(); 271 void sltTypeHostKeyComboPressRelease(bool); 271 272 void sltTakeSnapshot(); 272 273 void sltShowInformationDialog();
Note:
See TracChangeset
for help on using the changeset viewer.