Skip to content

fix(android): Add "Show On-screen keyboard" preference to display OSK when physical keyboard is connected 👁️#14539

Merged
darcywong00 merged 3 commits intomasterfrom
fix/android/36-hidden
Aug 20, 2025
Merged

fix(android): Add "Show On-screen keyboard" preference to display OSK when physical keyboard is connected 👁️#14539
darcywong00 merged 3 commits intomasterfrom
fix/android/36-hidden

Conversation

@darcywong00
Copy link
Copy Markdown
Contributor

@darcywong00 darcywong00 commented Aug 18, 2025

Follows #14538 in addressing #14533

This adds a Keyman app settings preference to show the on-screen keyboard while using physical keyboard.

settings-screen-ap

Rather than using a resource string to get the shared preference (see #13633), this also starts a new PreferencesManager class for managing these string constants. Separating kma_prefs_name between the Keyman Engine for Android and Keyman for Android app will be addressed in #13633.

  • Also updates the in-app help for the new preference setting.

As of now, I'm leaning towards not 🍒 picking a new preference to stable-18.0.
But the FirstVoices app would need a similar setting.

User Testing

Setup - Install the PR build of Keyman for Android on an Android emulator of API 36.
In the Keyman "Get Started" menu, set Keyman as the default system keyboard.

Also set Gboard to display on-screen keyboard:
device Settings --> Keyboard --> On-screen keyboard --> click Gboard --> Physical keyboard --> Show on-screen keyboard to "on"
back to Gboard settings --> write in text fields --> Use stylus to write in text fields , set to "off"

  • TEST_PREFERENCE_OFF - Verifies Keyman OSK doesn't appear by default
  1. Launch Keyman
  2. Got to Keyman settings --> verify "Show on-screen keyboard" has a default value off
  3. Launch Chrome and select a text area
  4. Verify the Keyman system OSK does not appear
  • TEST_PREFERENCE_ON - Verifies Keyman OSK appears when "Show OSK" is on
  1. Launch Keyman
  2. Got to Keyman settings --> set "Show on-screen keyboard" to on
  3. Completely close the Keyman app
  4. Launch Chrome and select a text area
  5. If the system keyboard is Gboard, longpress the globe button to switch to Keyman system keyboard
  6. Verify the Keyman system OSK appears
  7. Verify the Keyman keyboard and suggestion banner functions

@darcywong00 darcywong00 added this to the A19S10 milestone Aug 18, 2025
@github-project-automation github-project-automation bot moved this to Todo in Keyman Aug 18, 2025
@keymanapp-test-bot keymanapp-test-bot bot added has-user-test user-test-required User tests have not been completed labels Aug 18, 2025
@keymanapp-test-bot
Copy link
Copy Markdown

keymanapp-test-bot bot commented Aug 18, 2025

Comment on lines +289 to +292
Context context = getApplicationContext();
SharedPreferences prefs = context.getSharedPreferences(PreferencesManager.kma_prefs_name, Context.MODE_PRIVATE);
boolean showOSK = prefs.getBoolean(KeymanSettingsActivity.oskWithPhysicalKeyboardKey, false);
return showOSK;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

OK, so true is when we do want it to be shown.

Referring to #14538, I see that we did not port this to the FV and sample apps? I assume they'll get their own PRs, then?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

But the FirstVoices app would need a similar setting.

Yep, will have a follow-on PR for FirstVoices. I think I'll leave it out of the Sample apps though.

@mcdurdin
Copy link
Copy Markdown
Member

As of now, I'm leaning towards not 🍒 picking a new preference to stable-18.0.

Does this mean that stable-18.0 users on Android-36 may not able to use their keyboard? Or will it only impact users with external keyboards (and the emulator, which is less of a concern)?

Co-authored-by: Marc Durdin <marc@durdin.net>
@darcywong00
Copy link
Copy Markdown
Contributor Author

As of now, I'm leaning towards not 🍒 picking a new preference to stable-18.0.

Does this mean that stable-18.0 users on Android-36 may not able to use their keyboard? Or will it only impact users with external keyboards (and the emulator, which is less of a concern)?

I plan to 🍒 pick the base #14538 to stable-18.0. This would override showOSK to true so the OSK will always be displayed, even if physical keyboard is connected.

@darcywong00
Copy link
Copy Markdown
Contributor Author

As of now, I'm leaning towards not 🍒 picking a new preference to stable-18.0.

After discussing more with @mcdurdin about this impact on stable-18.0, we'll go ahead and 🍒 pick this too.
Priority is 🍒 picking the activities to work on API 35+, and then this PR.

@Nnyny Nnyny self-assigned this Aug 20, 2025
@Nnyny
Copy link
Copy Markdown
Contributor

Nnyny commented Aug 20, 2025

Test Results

Before testing:
- Turn on 'Show on-screen keyboard'
- Turn off 'Use stylus to write in text fields'
- Install keyman-19.0.101-alpha-test-14539
- On Get Started, select 'Enable Keyman as system-wide keyboard'

  • TEST_PREFERENCE_OFF (PASSED): notes
  1. Go to Keyman setting and verify 'Show on-screen keyboard' is off
  2. Go to Chrome, select the text area
  3. Verify that Keyman keyboard doesn't show up
  • TEST_PREFERENCE_ON (PASSED): notes
  1. Go to Keyman setting and turn on 'Show on-screen keyboard'
  2. Close Keyman and go to Chrome
  3. Select the text area, Gboard keyboard appears
  4. Select the globe, Keyman keyboard finally appears
  5. Verify EuroLatin keyboard and dictionary are functioning ok

@keymanapp-test-bot keymanapp-test-bot bot removed the user-test-required User tests have not been completed label Aug 20, 2025
Base automatically changed from fix/android/onEvaluateInputViewShown to master August 20, 2025 02:33
@darcywong00 darcywong00 merged commit 0a83faa into master Aug 20, 2025
7 checks passed
@darcywong00 darcywong00 deleted the fix/android/36-hidden branch August 20, 2025 02:34
@github-project-automation github-project-automation bot moved this from Todo to Done in Keyman Aug 20, 2025
@keyman-server
Copy link
Copy Markdown
Collaborator

Changes in this pull request will be available for download in Keyman version 19.0.103-alpha

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

6 participants