Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
WIN32ungetch does serve the purpose it was added for - unget a zero value which is the first-of-two return values of a scan code.
However, there were some cases which never worked, like ungetting any UTF-8 byte except the first (of a sequence of up to 4), where the next WIN32getch call simply ignores the ch argument to WIN32ungetch.
Additionally, some other cases got broken at 6fd6739 , because the unget code was depending on buggy unicode behavior - which is now fixed. E.g. unget the second-of-two scan code return values is broken.
Instead of trying to modify the quite-complex KB queue state (unicode state, x11 mouse state, scan code state) in a way which will restore the current state after the next WIN32getch call, this commit simply bypasses the KB queue state, and should ensure it always works.