-
Notifications
You must be signed in to change notification settings - Fork 1.6k
fix keyboard input in mobile browsers #1317
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
Conversation
Thanks, this looks like a good approach! We could use some help with testing. I've deployed this version here: https://copy.sh/v86-staging/ Testing on ios: Both versions open the OS keyboard and work fine. The only differences seems to be that the new version scrolls to the top of the screen. This probably needs an It would be nice if we could find a way to "downgrade" to using the keydown:
if(e.code === "Unspecified")
{
// let the input handler run
return;
}
// call preventDefault here to prevent the input handler
// or, if that is not robust, disable the input handler until the next keyup event |
Same on Android, it because Lines 2590 to 2592 in a3840e3
EDIT: I sketched out a few ideas on how to fix it:
|
I pushed a fix to prevent screen scrolling and tried to fix keyboard and mouse in graphical OSes (on copy.sh/v86 it always opens the keyboard). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apologies for the delay in reviewing this. I would still like to get this merged, but I'm not sure about the approach. See the comments below.
Thanks for the update! I've pushed the latest version here for testing again: https://copy.sh/v86-staging/?profile=buildroot
In my testing, Safari on iOS sent proper I spotted a minor regression, besides that this looks good to merge. Would be good to get some more testing in. |
Tested on Android-x86 9.0 VM: with default physical keyboard Firefox 141 and Chrome 138 also sent proper ![]() The keyboard works properly on https://copy.sh/v86. https://copy.sh/v86-staging and c5730de, as expected. The mouse cursor locks on click, just like on the desktop browsers. |
I got an physical keyboard and mouse for my Android 12 device, keyboard input works properly on https://copy.sh/v86-staging and on this PR (in Firefox and Chrome). The arrow keys, Ctrl and Shift also work. A few notes about mouse support: "Lock mouse" only works for me in Firefox (maybe because I tested on a phone?), but the mouse moves buggy. |
fix onclick handler, phone_keyboard follows text mode cursor always show phone keyboard
Squashed and merged, thanks! |
Fixes #262 (and probably #1212) by adding
input
event handler, tested in Chrome and Firefox on Android.