File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed
Controllers/KeyboardInput Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -192,6 +192,8 @@ MainWindow::MainWindow(QWidget* parent)
192192 keyboard, &QPushButton::clicked,
193193 this , [button = m_button_diagram.get ()](bool ){
194194 button->show ();
195+ button->raise (); // bring the window to front on macOS
196+ button->activateWindow (); // bring the window to front on Windows
195197 }
196198 );
197199 }
Original file line number Diff line number Diff line change @@ -13,11 +13,15 @@ namespace PokemonAutomation{
1313
1414
1515void QtKeyMap::record (const QKeyEvent& event){
16+ int qt_key = event.key ();
1617 uint32_t native_key = event.nativeVirtualKey ();
17- if (native_key == 0 ){
18+ if (native_key == 0 && (qt_key == 0 || qt_key == Qt::Key_unknown)){
19+ // both native key and Qt key event is 0 or unknown, meaning we really don't know
20+ // what key event it is. Skip
1821 return ;
1922 }
20- Qt::Key qkey = (Qt::Key)event.key ();
23+
24+ Qt::Key qkey = (Qt::Key)qt_key;
2125 WriteSpinLock lg (m_lock);
2226 m_map[native_key].insert (qkey);
2327}
You can’t perform that action at this time.
0 commit comments