From 897f6a44e86a84aa3fb9ffb6feede87abc01a4ca Mon Sep 17 00:00:00 2001 From: RichardG867 Date: Sat, 8 Apr 2023 21:42:06 -0300 Subject: [PATCH] qt: Attempt fix for Pause key with the new mappers --- src/qt/qt_mainwindow.cpp | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/src/qt/qt_mainwindow.cpp b/src/qt/qt_mainwindow.cpp index 95b881e64..b51a8a360 100644 --- a/src/qt/qt_mainwindow.cpp +++ b/src/qt/qt_mainwindow.cpp @@ -1394,12 +1394,19 @@ MainWindow::keyPressEvent(QKeyEvent *event) keyboard_input(1, 0x1D); keyboard_input(1, 0x45); } - } else + } else { #ifdef Q_OS_MACOS processMacKeyboardInput(true, event); #else - keyboard_input(1, x11_keycode_to_keysym(event->nativeScanCode())); + auto scan = x11_keycode_to_keysym(event->nativeVirtualKey()); + if (scan == 0x145) { + /* Special case for Pause. */ + keyboard_input(1, scan & 0xff00); + scan &= 0x00ff; + } + keyboard_input(1, scan); #endif + } } if ((video_fullscreen > 0) && keyboard_isfsexit()) { @@ -1446,7 +1453,13 @@ MainWindow::keyReleaseEvent(QKeyEvent *event) #ifdef Q_OS_MACOS processMacKeyboardInput(false, event); #else - keyboard_input(0, x11_keycode_to_keysym(event->nativeScanCode())); + auto scan = x11_keycode_to_keysym(event->nativeVirtualKey()); + if (scan == 0x145) { + /* Special case for Pause. */ + keyboard_input(0, scan & 0xff00); + scan &= 0x00ff; + } + keyboard_input(0, scan); #endif }