Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions workspace/all/settings/keyboardprompt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,8 @@ InputReactionHint KeyboardPrompt::handleInput(int &dirty, int &quit)

void KeyboardPrompt::handleKeyboardInput(AppState &state)
{
// redraw unless a key was not pressed
// redraw unless a key was not pressed (preserve pending redraws e.g. from setInitialText)
bool was_dirty = state.redraw;
state.redraw = true;

// track current keyboard layout
Expand Down Expand Up @@ -224,8 +225,8 @@ void KeyboardPrompt::handleKeyboardInput(AppState &state)
}
else
{
// do not redraw if no key was pressed
state.redraw = false;
// do not redraw if no key was pressed (but preserve pending redraws)
state.redraw = was_dirty;
}
}

Expand Down
4 changes: 4 additions & 0 deletions workspace/all/settings/keyboardprompt.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,12 @@ class KeyboardPrompt : public MenuList

// Set the initial text to display in the keyboard input field
void setInitialText(const std::string &text) {
// Reset state to allow re-editing after previous exit
state.quitting = false;
state.exit_code = ExitCode::Uninitialized;
state.keyboard.initial_text = text;
state.keyboard.current_text = text;
state.redraw = true;
}

private:
Expand Down
4 changes: 3 additions & 1 deletion workspace/all/settings/menu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,9 @@ InputReactionHint TextInputMenuItem::handleInput(int &dirty) {
// Open keyboard when A is pressed
if (PAD_justPressed(BTN_A)) {
if (on_confirm) {
return on_confirm(*this);
auto hint = on_confirm(*this);
dirty = 1;
return hint;
}
}
return Unhandled;
Expand Down
Loading