mirror of
https://github.com/rvtr/GodMode9i.git
synced 2025-06-18 19:05:30 -04:00
Make X clear string in keyboard (#226)
This commit is contained in:
parent
a727ca4152
commit
457a82481d
@ -59,7 +59,7 @@ std::string kbdGetString(std::string label, int maxSize, std::string oldStr) {
|
||||
}
|
||||
font->printf(2 + cursorPosition, labelHeight, false, Alignment::left, Palette::blackWhite, "%s", stringPosition < (int)output.size() ? output.substr(stringPosition, charLen).c_str() : " ");
|
||||
|
||||
font->print(firstCol, labelHeight + 2, false, STR_START_RETURN_B_BACKSPACE, alignStart);
|
||||
font->print(firstCol, labelHeight + 2, false, STR_START_RETURN_B_BACKSPACE_X_CLEAR, alignStart);
|
||||
font->update(false);
|
||||
|
||||
do {
|
||||
@ -67,7 +67,7 @@ std::string kbdGetString(std::string label, int maxSize, std::string oldStr) {
|
||||
pressed = keysDownRepeat();
|
||||
key = keyboardUpdate();
|
||||
swiWaitForVBlank();
|
||||
} while (!((pressed & (KEY_LEFT | KEY_RIGHT | KEY_B | KEY_START | KEY_TOUCH)) || (key != -1)));
|
||||
} while (!((pressed & (KEY_LEFT | KEY_RIGHT | KEY_B | KEY_X | KEY_START | KEY_TOUCH)) || (key != -1)));
|
||||
|
||||
switch(key) {
|
||||
case NOKEY:
|
||||
@ -176,6 +176,10 @@ std::string kbdGetString(std::string label, int maxSize, std::string oldStr) {
|
||||
scrollPosition--;
|
||||
}
|
||||
}
|
||||
} else if(pressed & KEY_X) {
|
||||
output = "";
|
||||
stringPosition = 0;
|
||||
scrollPosition = 0;
|
||||
} else if(pressed & KEY_START) {
|
||||
done = true;
|
||||
}
|
||||
|
@ -189,7 +189,7 @@ STRING(A_SELECT_B_CANCEL, "(\\A select, \\B cancel)")
|
||||
STRING(START_CANCEL, "(START cancel)")
|
||||
STRING(UDLR_CHANGE_ATTRIBUTES, "(\\D change attributes)")
|
||||
STRING(A_APPLY_B_CANCEL, "(\\A apply, \\B cancel)")
|
||||
STRING(START_RETURN_B_BACKSPACE, "(START Return, \\B Backspace)")
|
||||
STRING(START_RETURN_B_BACKSPACE_X_CLEAR, "(START Return, \\B Backspace, \\X Clear)")
|
||||
|
||||
// Byte counts
|
||||
STRING(1_BYTE, "1 Byte")
|
||||
|
Loading…
Reference in New Issue
Block a user