Skip to content

android keyboard not working #262

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

Open
strikersix23 opened this issue Dec 5, 2018 · 4 comments · May be fixed by #1317
Open

android keyboard not working #262

strikersix23 opened this issue Dec 5, 2018 · 4 comments · May be fixed by #1317

Comments

@strikersix23
Copy link

on android native keyboard not working while loading text-based oses

@copy
Copy link
Owner

copy commented Jan 18, 2019

Can confirm this, unfortunately bringing up a keyboard and capturing keyup and keydown events is quite tricky across mobile browsers.

@copy copy added the bug label Jan 18, 2019
@copy copy added the mobile label Aug 2, 2019
@MailYouLater
Copy link
Contributor

Suggestion: Instead of using the mobile device's touch keyboard with their mobile-centric layout and awkward input capture methods, simulate a keyboard with a real PC layout with an html/js virtual keyboard on the page.

@odog8
Copy link

odog8 commented Feb 2, 2022

My suggestion for this issue would be to send text using an <input> html tag.

@SuperMaxusa
Copy link
Contributor

I tested Chrome and Firefox on Android and got some results:

Chrome fires a keyup/down event with the Unidentified key value other that the Enter key (https://issues.chromium.org/issues/41443178) and only the (before)input events are valid for text input.

demo video
chrome1.mp4

Firefox fires two events like the desktop version: the correct keyup/down event and the (before)input events. When deleting text, Firefox fires a keyup/down event with the Process key value and deleteContextBackwards as inputType, and fires a keyup/down event with the Backspace key value when the text input area is empty.
The Process key is a placeholder for IME events: https://stackoverflow.com/questions/71961563/keyboard-event-has-key-process-on-chromebook

demo video (2)
ffox1.mp4

Tested on:

  • OS: Android 12
  • Keyboard: GBoard 14.8
  • Firefox 132 (Release)
  • Chrome 131 (Release)

I have two possible solutions:

  • make an own virtual keyboard like a https://furcan.github.io/KioskBoard/, but this solution will have a significant amount of code implemented
  • leave the native keyboard and register the input event and simulate key presses. Since Firefox fires a keyup/down and input events at the same time, need to left only input event for Firefox Mobile or for all mobile browsers

Other notes:

  • in 2021, the VirtualKeyboard API was released, which has an interesting things: virtualKeyboard.show() method and the geometrychange event, but has limitations: only HTTPS pages and only Chrome are supported (for 2024-25)

Links for testing:

If someone has an iOS/iPadOS device, I'd be interested to hear the results on those OSes, thanks in advance!

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

Successfully merging a pull request may close this issue.

5 participants