commit 7cc28ffd
Move more naturally around on the virtual keyboard
Moving off to the left now moves to the line end and going of right moves to the beginning
Changed files
| M | source/code/DialogBox.cpp before |
diff --git a/source/code/DialogBox.cpp b/source/code/DialogBox.cpp
index ba54c14..4b23303 100644
--- a/source/code/DialogBox.cpp
+++ b/source/code/DialogBox.cpp
@@ -269,9 +269,18 @@ void DialogBox::ProcessInput(const SDL_Event& event, bool& processed) {
rk->cursorRight();
}
if (isRightEvent(event)) {
+ if ( (virtualKeyboard.selectedChar+1)/keyboardRowLimit != virtualKeyboard.selectedChar/keyboardRowLimit ) {
+ virtualKeyboard.selectedChar -= keyboardRowLimit;
+ }
++virtualKeyboard.selectedChar;
+ if (virtualKeyboard.selectedChar >= static_cast<int>(virtualKeyboard.gamePadCharFields.size())) {
+ virtualKeyboard.selectedChar -= virtualKeyboard.selectedChar%keyboardRowLimit;
+ }
}
if (isLeftEvent(event)) {
+ if ( (virtualKeyboard.selectedChar-1)/keyboardRowLimit != virtualKeyboard.selectedChar/keyboardRowLimit || virtualKeyboard.selectedChar == 0 ) {
+ virtualKeyboard.selectedChar += keyboardRowLimit;
+ }
--virtualKeyboard.selectedChar;
}
if (isDownEvent(event)) {