summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMai M <mathew1800@gmail.com>2021-12-15 05:42:07 +0100
committerGitHub <noreply@github.com>2021-12-15 05:42:07 +0100
commitf0ed11e3180f9d241881576ac2f62e50dddd7804 (patch)
treed400260e24cde5fbea0144be468f288937ff5884
parentMerge pull request #7583 from german77/triggered (diff)
parentqt_software_keyboard: Fix out of bounds array access (diff)
downloadyuzu-f0ed11e3180f9d241881576ac2f62e50dddd7804.tar
yuzu-f0ed11e3180f9d241881576ac2f62e50dddd7804.tar.gz
yuzu-f0ed11e3180f9d241881576ac2f62e50dddd7804.tar.bz2
yuzu-f0ed11e3180f9d241881576ac2f62e50dddd7804.tar.lz
yuzu-f0ed11e3180f9d241881576ac2f62e50dddd7804.tar.xz
yuzu-f0ed11e3180f9d241881576ac2f62e50dddd7804.tar.zst
yuzu-f0ed11e3180f9d241881576ac2f62e50dddd7804.zip
-rw-r--r--src/yuzu/applets/qt_software_keyboard.cpp23
1 files changed, 19 insertions, 4 deletions
diff --git a/src/yuzu/applets/qt_software_keyboard.cpp b/src/yuzu/applets/qt_software_keyboard.cpp
index de7f98c4f..c3857fc98 100644
--- a/src/yuzu/applets/qt_software_keyboard.cpp
+++ b/src/yuzu/applets/qt_software_keyboard.cpp
@@ -475,11 +475,26 @@ void QtSoftwareKeyboardDialog::open() {
row = 0;
column = 0;
- const auto* const curr_button =
- keyboard_buttons[static_cast<int>(bottom_osk_index)][row][column];
+ switch (bottom_osk_index) {
+ case BottomOSKIndex::LowerCase:
+ case BottomOSKIndex::UpperCase: {
+ const auto* const curr_button =
+ keyboard_buttons[static_cast<std::size_t>(bottom_osk_index)][row][column];
+
+ // This is a workaround for setFocus() randomly not showing focus in the UI
+ QCursor::setPos(curr_button->mapToGlobal(curr_button->rect().center()));
+ break;
+ }
+ case BottomOSKIndex::NumberPad: {
+ const auto* const curr_button = numberpad_buttons[row][column];
- // This is a workaround for setFocus() randomly not showing focus in the UI
- QCursor::setPos(curr_button->mapToGlobal(curr_button->rect().center()));
+ // This is a workaround for setFocus() randomly not showing focus in the UI
+ QCursor::setPos(curr_button->mapToGlobal(curr_button->rect().center()));
+ break;
+ }
+ default:
+ break;
+ }
StartInputThread();
}