diff --git a/Gui/Gui50.cpp b/Gui/Gui50.cpp index 8cc67226cd..5987d57fa2 100644 --- a/Gui/Gui50.cpp +++ b/Gui/Gui50.cpp @@ -389,7 +389,7 @@ Gui::setLastKeyUpVisitedClickFocus(bool visited) int Gui::handleNativeKeys(int key, quint32 nativeScanCode, quint32 nativeVirtualKey) { - qDebug() << "scancode=" << nativeScanCode << "virtualkey=" << nativeVirtualKey; + //qDebug() << "scancode=" << nativeScanCode << "virtualkey=" << nativeVirtualKey; #ifdef Q_WS_MAC // OS X virtual key codes, from // MacOSX10.11.sdk/System/Library/Frameworks/Carbon.framework/Frameworks/HIToolbox.framework/Headers/Events.h @@ -440,6 +440,7 @@ Gui::handleNativeKeys(int key, quint32 nativeScanCode, quint32 nativeVirtualKey) // 55 0x37 (VK_7) | 7 key // 56 0x38 (VK_8) | 8 key // 57 0x39 (VK_9) | 9 key + // Windows seems to always return the same virtual key for digits, whatever the modifi Q_UNUSED(nativeScanCode); switch (nativeVirtualKey) { case 0x30: @@ -466,7 +467,7 @@ Gui::handleNativeKeys(int key, quint32 nativeScanCode, quint32 nativeVirtualKey) #endif #if defined(Q_WS_X11) && defined(Q_OS_LINUX) #pragma message WARN("TODO: handle keys 0-9 on AZERTY keyboards") - // probably only possible on Linux + // probably only possible on Linux, since scancodes are OS-dependent // https://www.win.tue.nl/~aeb/linux/kbd/scancodes-1.html Q_UNUSED(nativeVirtualKey); switch (nativeScanCode) { @@ -498,7 +499,7 @@ Gui::handleNativeKeys(int key, quint32 nativeScanCode, quint32 nativeVirtualKey) void Gui::keyPressEvent(QKeyEvent* e) { - qDebug() << "Gui::keyPressed:" << e->text() << "modifiers:" << e->modifiers(); + //qDebug() << "Gui::keyPressed:" << e->text() << "modifiers:" << e->modifiers(); if (_imp->currentPanelFocusEventRecursion > 0) { return; } diff --git a/Gui/GuiApplicationManager10.cpp b/Gui/GuiApplicationManager10.cpp index 700087300b..a2fd53705a 100644 --- a/Gui/GuiApplicationManager10.cpp +++ b/Gui/GuiApplicationManager10.cpp @@ -796,8 +796,7 @@ GuiApplicationManager::populateShortcuts() registerKeybind(kShortcutGroupGlobal, kShortcutIDActionEnableRenderStats, kShortcutDescActionEnableRenderStats, Qt::NoModifier, Qt::Key_F2); -#ifdef Q_WS_MAC - // Note: keys 0-1 are handles by Gui::handleNativeKeys(), and should thus work even on international keyboards + // Note: keys 0-1 are handled by Gui::handleNativeKeys(), and should thus work even on international keyboards registerKeybind(kShortcutGroupGlobal, kShortcutIDActionConnectViewerToInput1, kShortcutDescActionConnectViewerToInput1, Qt::NoModifier, Qt::Key_1); registerKeybind(kShortcutGroupGlobal, kShortcutIDActionConnectViewerToInput2, kShortcutDescActionConnectViewerToInput2, Qt::NoModifier, Qt::Key_2); registerKeybind(kShortcutGroupGlobal, kShortcutIDActionConnectViewerToInput3, kShortcutDescActionConnectViewerToInput3, Qt::NoModifier, Qt::Key_3); @@ -818,30 +817,6 @@ GuiApplicationManager::populateShortcuts() registerKeybind(kShortcutGroupGlobal, kShortcutIDActionConnectViewerBToInput8, kShortcutDescActionConnectViewerBToInput8, Qt::ShiftModifier, Qt::Key_8); registerKeybind(kShortcutGroupGlobal, kShortcutIDActionConnectViewerBToInput9, kShortcutDescActionConnectViewerBToInput9, Qt::ShiftModifier, Qt::Key_9); registerKeybind(kShortcutGroupGlobal, kShortcutIDActionConnectViewerBToInput10, kShortcutDescActionConnectViewerBToInput10, Qt::ShiftModifier, Qt::Key_0); -#else -#pragma message WARN("TODO: Gui::handleNativeKeys() on X11/linux and Win") - registerKeybindWithMask(kShortcutGroupGlobal, kShortcutIDActionConnectViewerToInput1, kShortcutDescActionConnectViewerToInput1, Qt::NoModifier, Qt::Key_1, - Qt::ShiftModifier); - registerKeybindWithMask(kShortcutGroupGlobal, kShortcutIDActionConnectViewerToInput2, kShortcutDescActionConnectViewerToInput2, Qt::NoModifier, Qt::Key_2, - Qt::ShiftModifier); - registerKeybindWithMask(kShortcutGroupGlobal, kShortcutIDActionConnectViewerToInput3, kShortcutDescActionConnectViewerToInput3, Qt::NoModifier, Qt::Key_3, - Qt::ShiftModifier); - registerKeybindWithMask(kShortcutGroupGlobal, kShortcutIDActionConnectViewerToInput4, kShortcutDescActionConnectViewerToInput4, Qt::NoModifier, Qt::Key_4, - Qt::ShiftModifier); - registerKeybindWithMask(kShortcutGroupGlobal, kShortcutIDActionConnectViewerToInput5, kShortcutDescActionConnectViewerToInput5, Qt::NoModifier, Qt::Key_5, - Qt::ShiftModifier); - registerKeybindWithMask(kShortcutGroupGlobal, kShortcutIDActionConnectViewerToInput6, kShortcutDescActionConnectViewerToInput6, Qt::NoModifier, Qt::Key_6, - Qt::ShiftModifier); - registerKeybindWithMask(kShortcutGroupGlobal, kShortcutIDActionConnectViewerToInput7, kShortcutDescActionConnectViewerToInput7, Qt::NoModifier, Qt::Key_7, - Qt::ShiftModifier); - registerKeybindWithMask(kShortcutGroupGlobal, kShortcutIDActionConnectViewerToInput8, kShortcutDescActionConnectViewerToInput8, Qt::NoModifier, Qt::Key_8, - Qt::ShiftModifier); - registerKeybindWithMask(kShortcutGroupGlobal, kShortcutIDActionConnectViewerToInput9, kShortcutDescActionConnectViewerToInput9, Qt::NoModifier, Qt::Key_9, - Qt::ShiftModifier); - registerKeybindWithMask(kShortcutGroupGlobal, kShortcutIDActionConnectViewerToInput10, kShortcutDescActionConnectViewerToInput10, Qt::NoModifier, Qt::Key_0, - Qt::ShiftModifier); - -#endif registerKeybind(kShortcutGroupGlobal, kShortcutIDActionShowPaneFullScreen, kShortcutDescActionShowPaneFullScreen, Qt::NoModifier, Qt::Key_Space); registerKeybind(kShortcutGroupGlobal, kShortcutIDActionNextTab, kShortcutDescActionNextTab, Qt::ControlModifier, Qt::Key_T); diff --git a/Gui/ViewerTab10.cpp b/Gui/ViewerTab10.cpp index 7d687c0cf7..92bb08bd8c 100644 --- a/Gui/ViewerTab10.cpp +++ b/Gui/ViewerTab10.cpp @@ -544,7 +544,7 @@ ViewerTab::leaveEvent(QEvent* e) void ViewerTab::keyPressEvent(QKeyEvent* e) { - qDebug() << "ViewerTab::keyPressed:" << e->text() << "modifiers:" << e->modifiers(); + //qDebug() << "ViewerTab::keyPressed:" << e->text() << "modifiers:" << e->modifiers(); if ( getGui() ) { getGui()->setActiveViewer(this); }