Fix Android keycode translation and duplicate key constants #3733
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 #3729
Fixes #3734
All of the keys I am able to test are correct. However, I cannot test the keypad (because I use a tenkeyless keyboard), the keyboard menu key (because my keyboard lacks it) and the Android menu key (because my phone lacks it and also because of #3734). Additionally, the Super (Windows) and Print Screen keys are grabbed by the system and apparently cannot be caught by the app.
Note: there seems to be an issue (already present, not introduced by this PR) in which the app freezes on Android if a keyboard is connected after the app starts. For this reason, I recommend testers to connect a keyboard and force stop the test app before starting it(fixed by includingkeyboard
in the manifest'sandroid:configChanges
).Update: with 1df491c, #3734 is also fixed, but it introduces a breaking change, as the value of
KEY_MENU
is changed.Code example