From 34f8f0759a0710ff4a18b3803742ca333f48f1fc Mon Sep 17 00:00:00 2001 From: egisz Date: Fri, 30 Oct 2020 18:01:39 +0000 Subject: [PATCH] add 1 and 2 key to settings menu as TAB --- src/autoapp/UI/SettingsWindow.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/autoapp/UI/SettingsWindow.cpp b/src/autoapp/UI/SettingsWindow.cpp index 059244a..08bc960 100644 --- a/src/autoapp/UI/SettingsWindow.cpp +++ b/src/autoapp/UI/SettingsWindow.cpp @@ -1423,4 +1423,13 @@ void f1x::openauto::autoapp::ui::SettingsWindow::keyPressEvent(QKeyEvent *event) { f1x::openauto::autoapp::ui::SettingsWindow::close(); } + if (event->key() == Qt::Key_Return || event->key() == Qt::Key_Return) { + QApplication::postEvent (QApplication::focusWidget(), new QKeyEvent ( QEvent::KeyPress, Qt::Key_Space, Qt::NoModifier)); + } + if (event->key() == Qt::Key_1) { + QApplication::postEvent (QApplication::focusWidget(), new QKeyEvent ( QEvent::KeyPress, Qt::Key_Tab, Qt::ShiftModifier)); + } + if (event->key() == Qt::Key_2) { + QApplication::postEvent (QApplication::focusWidget(), new QKeyEvent ( QEvent::KeyPress, Qt::Key_Tab, Qt::NoModifier)); + } }