ImGui: a suppressed text event no longer eats the next character (B8)
Ctrl+V, the zoom chords and new-window set a one-shot flag to drop the text event their key press would produce, but SDL sends none for Ctrl chords, so the flag dropped the next character typed instead (typing "xyz" after Ctrl+V gave "yz", reproduced under Xvfb). The flag now applies only until the next key press. C-k and Meta suffixes are still suppressed (checked: C-k s saves without inserting "s"; M-f moves without inserting "f"). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015rcVQiiWyTzoNrsvLSaAfB
This commit is contained in:
@@ -346,6 +346,11 @@ ImGuiInputHandler::ProcessSDLEvent(const SDL_Event &e)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
case SDL_KEYDOWN: {
|
case SDL_KEYDOWN: {
|
||||||
|
// A suppression request covers only the text event of the key that
|
||||||
|
// made it, which arrives before the next key press. Chords such as
|
||||||
|
// Ctrl+V produce no text event at all, and a leftover request ate
|
||||||
|
// the next character typed (B8).
|
||||||
|
suppress_text_input_once_ = false;
|
||||||
// Remember state before mapping; used for TEXTINPUT suppression heuristics
|
// Remember state before mapping; used for TEXTINPUT suppression heuristics
|
||||||
const bool was_k_prefix = k_prefix_;
|
const bool was_k_prefix = k_prefix_;
|
||||||
const bool was_esc_meta = esc_meta_;
|
const bool was_esc_meta = esc_meta_;
|
||||||
|
|||||||
Reference in New Issue
Block a user