Fixed space input under SDL2 for some Android keyboards #4712
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.
Not for merging without further discussion - this seems to work without causing more problems, but I'm PRing mainly to report the issue and a possible fix.
The problem is that on android we listen only for textinput events, which is how text is supposed to be passed by sdl2. Some keyboards (e.g. LG G4 default) pass only textinput events. Others (e.g. Motorola E default) pass both a textinput event and keydown/keyup events for each key, which is why the current behaviour is to ignore the latter. However, in some cases the space character is passed only as keydown/keyup, not as textinput, so it is also ignored.
This PR would just recognise the space character. I don't know how reliable it is - it could cause another problem on any device that passes both keydown/keyup and textinput events for space characters.