mirror of
https://github.com/d0k3/GodMode9.git
synced 2025-06-26 13:42:47 +00:00
swkbd: Fix deleting the last char in a string
This commit is contained in:
parent
d928591a80
commit
ccb8531ce6
@ -281,10 +281,12 @@ bool ShowKeyboard(char* inputstr, const u32 max_size, const char *format, ...) {
|
||||
break;
|
||||
} else if (key == KEY_BKSPC) {
|
||||
if (cursor) {
|
||||
memmove(inputstr + cursor - 1, inputstr + cursor, max_size - cursor);
|
||||
cursor--;
|
||||
if (cursor <= inputstr_size) {
|
||||
memmove(inputstr + cursor - 1, inputstr + cursor, inputstr_size - cursor + 1);
|
||||
inputstr_size--;
|
||||
}
|
||||
cursor--;
|
||||
}
|
||||
} else if (key == KEY_LEFT) {
|
||||
if (cursor) cursor--;
|
||||
} else if (key == KEY_RIGHT) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user