diff options
| -rw-r--r-- | src/yuzu/applets/qt_software_keyboard.cpp | 14 |
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) { | |||
| 1401 | } | 1401 | } |
| 1402 | }; | 1402 | }; |
| 1403 | 1403 | ||
| 1404 | // Store the initial row and column. | ||
| 1405 | const auto initial_row = row; | ||
| 1406 | const auto initial_column = column; | ||
| 1407 | |||
| 1404 | switch (bottom_osk_index) { | 1408 | switch (bottom_osk_index) { |
| 1405 | case BottomOSKIndex::LowerCase: | 1409 | case BottomOSKIndex::LowerCase: |
| 1406 | case BottomOSKIndex::UpperCase: { | 1410 | case BottomOSKIndex::UpperCase: { |
| @@ -1411,6 +1415,11 @@ void QtSoftwareKeyboardDialog::MoveButtonDirection(Direction direction) { | |||
| 1411 | auto* curr_button = keyboard_buttons[index][row][column]; | 1415 | auto* curr_button = keyboard_buttons[index][row][column]; |
| 1412 | 1416 | ||
| 1413 | while (!curr_button || !curr_button->isEnabled() || curr_button == prev_button) { | 1417 | while (!curr_button || !curr_button->isEnabled() || curr_button == prev_button) { |
| 1418 | // If we returned back to where we started from, break the loop. | ||
| 1419 | if (row == initial_row && column == initial_column) { | ||
| 1420 | break; | ||
| 1421 | } | ||
| 1422 | |||
| 1414 | move_direction(NUM_ROWS_NORMAL, NUM_COLUMNS_NORMAL); | 1423 | move_direction(NUM_ROWS_NORMAL, NUM_COLUMNS_NORMAL); |
| 1415 | curr_button = keyboard_buttons[index][row][column]; | 1424 | curr_button = keyboard_buttons[index][row][column]; |
| 1416 | } | 1425 | } |
| @@ -1425,6 +1434,11 @@ void QtSoftwareKeyboardDialog::MoveButtonDirection(Direction direction) { | |||
| 1425 | auto* curr_button = numberpad_buttons[row][column]; | 1434 | auto* curr_button = numberpad_buttons[row][column]; |
| 1426 | 1435 | ||
| 1427 | while (!curr_button || !curr_button->isEnabled() || curr_button == prev_button) { | 1436 | while (!curr_button || !curr_button->isEnabled() || curr_button == prev_button) { |
| 1437 | // If we returned back to where we started from, break the loop. | ||
| 1438 | if (row == initial_row && column == initial_column) { | ||
| 1439 | break; | ||
| 1440 | } | ||
| 1441 | |||
| 1428 | move_direction(NUM_ROWS_NUMPAD, NUM_COLUMNS_NUMPAD); | 1442 | move_direction(NUM_ROWS_NUMPAD, NUM_COLUMNS_NUMPAD); |
| 1429 | curr_button = numberpad_buttons[row][column]; | 1443 | curr_button = numberpad_buttons[row][column]; |
| 1430 | } | 1444 | } |