possible fix to the linux e,s,r bug in text editor. #2334
Merged
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.
Fixes #1071
So it was a bug in kOS, but a bug that got hidden by Unity's order of handling input events on Windows.
The bug - While I was only reacting to the E, S, or T keys when "control" was pressed, which is correct, I was still "consuming" those keyboard events unconditionally whether the control key was down or not.
Why it didn't affect Windows: Apparently in Windows the generic Textfield GUI widget from Unity's IMGUI (the thing the text editor really is), got first dibs on the keyboard events before my code did, so my code never got to see key events that the Textfield used, so S, E, and R never got seen by my code unless they were accompanied by special ctrl- or alt- keys. Vanilla S, E, and R keys never reached my code - the Textfield got them first and consumed them.
On Linux they seem to be queued in the opposite order so that my mistaken consuming of the key happened before the Textfield got to see it.