summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMorph <39850852+Morph1984@users.noreply.github.com>2022-07-24 13:27:10 +0200
committerMorph <39850852+Morph1984@users.noreply.github.com>2022-07-24 13:27:41 +0200
commitd7d09355e723270870fde85c1000988bfd48f2ca (patch)
treea55f6ec1ec25f8b69570050dd85baf58685feaf3 /src
parentapplet/swkbd: Implement optional symbol keys (diff)
downloadyuzu-d7d09355e723270870fde85c1000988bfd48f2ca.tar
yuzu-d7d09355e723270870fde85c1000988bfd48f2ca.tar.gz
yuzu-d7d09355e723270870fde85c1000988bfd48f2ca.tar.bz2
yuzu-d7d09355e723270870fde85c1000988bfd48f2ca.tar.lz
yuzu-d7d09355e723270870fde85c1000988bfd48f2ca.tar.xz
yuzu-d7d09355e723270870fde85c1000988bfd48f2ca.tar.zst
yuzu-d7d09355e723270870fde85c1000988bfd48f2ca.zip
Diffstat (limited to 'src')
-rw-r--r--src/yuzu/applets/qt_software_keyboard.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/yuzu/applets/qt_software_keyboard.cpp b/src/yuzu/applets/qt_software_keyboard.cpp
index 91dca2760..e60506197 100644
--- a/src/yuzu/applets/qt_software_keyboard.cpp
+++ b/src/yuzu/applets/qt_software_keyboard.cpp
@@ -1401,6 +1401,10 @@ void QtSoftwareKeyboardDialog::MoveButtonDirection(Direction direction) {
}
};
+ // Store the initial row and column.
+ const auto initial_row = row;
+ const auto initial_column = column;
+
switch (bottom_osk_index) {
case BottomOSKIndex::LowerCase:
case BottomOSKIndex::UpperCase: {
@@ -1411,6 +1415,11 @@ void QtSoftwareKeyboardDialog::MoveButtonDirection(Direction direction) {
auto* curr_button = keyboard_buttons[index][row][column];
while (!curr_button || !curr_button->isEnabled() || curr_button == prev_button) {
+ // If we returned back to where we started from, break the loop.
+ if (row == initial_row && column == initial_column) {
+ break;
+ }
+
move_direction(NUM_ROWS_NORMAL, NUM_COLUMNS_NORMAL);
curr_button = keyboard_buttons[index][row][column];
}
@@ -1425,6 +1434,11 @@ void QtSoftwareKeyboardDialog::MoveButtonDirection(Direction direction) {
auto* curr_button = numberpad_buttons[row][column];
while (!curr_button || !curr_button->isEnabled() || curr_button == prev_button) {
+ // If we returned back to where we started from, break the loop.
+ if (row == initial_row && column == initial_column) {
+ break;
+ }
+
move_direction(NUM_ROWS_NUMPAD, NUM_COLUMNS_NUMPAD);
curr_button = numberpad_buttons[row][column];
}