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(android): use main looper to dispatch key events when OSK is hidden #12871

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jahorton
Copy link
Contributor

Fixes: #12366
Supersedes: #12381

Alas, it would appear that we cannot rely on the WebView's version of postDelayed, as apparently that doesn't actually trigger delayed events when the WebView has been detached! We can, however, construct a Handler instance and link it to the UI thread's looper in order to achieve our desired effect.

User Testing

Setup - Install the PR build of Keyman for Android on a physical device. Also pair an external keyboard (USB/bluetooth) to the device

TEST_KEYBOARD - Verifies external keyboard works when virtual keyboard hidden

  1. Launch Keyman
  2. From "Get Started", enable Keyman as the default system keyboard
  3. Launch a separate app where you can type in (ideally a note taking app like Keep or OneNote as reported in the issue). If those aren't available, Chrome browser works
  4. Select a text area with Keyman sil_euro_latin selected as the system keyboard
  5. Verify the system keyboard types fine (longpresses, switching, keys, etc).
  6. With the virtual keyboard displayed, type on the physical keyboard ` a
  7. Verify the text becomes à.
  8. From the Android system preferences, select "Language and Keyboard" --> Physical keyboard --> Toggle "show on-screen keyboard" so that the OSK is hidden
  9. Return to the note-taking / Chrome app and select a text field
  10. Type on the physical keyboard ` a
  11. Verify the text becomes à

Please repeat the test a few times, verifying that no errors are triggered during any attempt.

@keymanapp-test-bot
Copy link

keymanapp-test-bot bot commented Jan 10, 2025

User Test Results

Test specification and instructions

  • TEST_KEYBOARD (OPEN)
Results Template
# Test Results

* **TEST_KEYBOARD (OPEN):** notes

Test Artifacts

Copy link
Contributor

@darcywong00 darcywong00 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm.
Thanks for finding this!

@darcywong00
Copy link
Contributor

darcywong00 commented Jan 12, 2025

Can you also 🍒 pick to 17.0 so we can unblock the community site user?

nvm - I made the 🍒 pick in #12875

@jahorton jahorton changed the title fix(android): processing of hardware keystrokes when OSK is hidden fix(android): use main looper to dispatch key events when OSK is hidden Jan 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

bug(android): External physical keyboard doesn't type when virtual keyboard hidden
2 participants