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

Android Keyboard Fallback & Other Improvements #10

Merged
merged 38 commits into from
Jun 8, 2024
Merged

Conversation

FlamedDogo99
Copy link
Owner

Big Changes!

Keyboard support (Android and iOS):

  • Added window.keyboardFix, which controls wether keydown or input events are used for keyboard capture.
  • Added input monitoring to seamlessly transition between window.keyboardFix states

Better keyEvent functions

  • Consolidated shiftKeyEvent(), deleteKeyEvent(), and keyEvent() into a single keyEvent function that supports more keys
  • All keyboardEvents should either be called through keyEvent() or set event.isValid to true to allow the input keyboard events to work

Fake pointerlock and fullscreen API

  • Pointerlock and the fullscreen API are read-only on some mobile devices, even though they had no functionality. This is now no longer the case

Also I accidentally converted all the tabs to spaces, thus the large diff. I think this will be the standard from now on
I really hope this works
If this doesn’t work on android, I don’t know what will
Only injects code on keypress event listeners
Removed shiftKeyEvent and deleteKeyEvent
First attempt:
hiddenInput saves the most recent value to window.lastKey
If we detect a keydown event with invalid key, keyCode or which, we enable window.keyboardFix, and redispatch the key from window.lastKey
The keyboard blocking function now checks for window.keyboardFix
I keep getting an undefined error
I honestly have no idea
@FlamedDogo99 FlamedDogo99 linked an issue Jun 7, 2024 that may be closed by this pull request
@FlamedDogo99 FlamedDogo99 changed the title Keyboard fix Android Keyboard Fallback & Other Improvements Jun 7, 2024
@FlamedDogo99
Copy link
Owner Author

FlamedDogo99 commented Jun 7, 2024

To-do:

  • Overhall readme.md with relevant information and documentation

@FlamedDogo99 FlamedDogo99 merged commit c45f40a into main Jun 8, 2024
@FlamedDogo99 FlamedDogo99 deleted the keyboard-fix branch June 8, 2024 16:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug] Keyboard issue on Android mobile devices
1 participant