Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix pressing keys on a hardware keyboard showing the software keyboard #5274

Merged
merged 4 commits into from
Jun 28, 2022

Conversation

Susko3
Copy link
Member

@Susko3 Susko3 commented Jun 27, 2022

By default, Android will show the software keyboard while text input is active even if a hardware keyboard is connected. And since we were always returning a valid IInputConnection, Android would "conveniently" show the software keyboard when any hardware keys are pressed.

Pressing keys will (re)focus the current view and probe OnCreateInputConnection() to see if the input method is to be activated.

The docs specify to return null when input methods are not supported by a specific View. Since we have only one View, returning null here means to disable text input for the time being (until a textbox is focused and AndroidTextInput is activated).

@Susko3
Copy link
Member Author

Susko3 commented Jun 27, 2022

Discovered a bug, this has completely broken AndroidInputConnection, as evident by CommitText not getting fired.

Fixes `AndroidInputConnection` sometimes not working properly because
`OnCreateInputConnection()` was not being called by Android.
@peppy
Copy link
Member

peppy commented Jun 28, 2022

Probably best to get a second check on this one, looks okay code-wise though.

@peppy peppy requested a review from bdach June 28, 2022 02:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

osu!lazer android keyboard keep showing after pressing keys in keyboard Keyboard called at startup
3 participants