-
Notifications
You must be signed in to change notification settings - Fork 63
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
Support Android browser text input #263
Conversation
Some Android browsers can not type in text input fields. I leveraged window.onTextInput to detect text changes and refactored code to remove redundancies and improve performance. Some mobile targets also require touch detection. I've tested typing and pasting text on desktop, mobile and web (both GeckoView and WebView browsers). These changes are working with the latest versions of OpenFL and Lime.
Only add new listener code for mobile since Chromium-based Android browsers are not receiving keyDown events. Experienced problems pasting text longer than 32 characters on Android builds, so we use a hybrid of the two.
It has been really sticky trying to make sure all desktop, native mobile, web (both mobile and desktop browsers, including testing for Firefox and Chrome on both) builds perform the same. The latest commit uses a hybrid method because native Android builds were experiencing an issue getting very long strings from the clipboard. |
@DigiEggz have you seen the new FlxInputText added to core flixel 5.9.0 (unreleased)? |
Is this one based on the one Starmapo ported or is it something entirely new? All other FlxInputText classes I've tested have their own sets of problems between OS and browsers. |
Uh... both? Starmapo made something entirely new based off of their own implementation and the existing flixel-ui implementation |
Sorry, I was wondering if it was Starmapo's work or something newer and unrelated. I had tried switching to their version a month or so ago (available as a library) and I experienced some input issues and had various user complaints, so I ended up switching back. I can't recall all of them, but I think some had to do with pasting long strings or certain characters and it was OS and build dependent. It took a lot of time to test everything. This patch has still been working across multiple devices without issue for me though. |
To clarify, this new FlxInputText was added to flixel (not flixel-ui) a couple days ago, hence why i said "entirely new" and "added to core flixel 5.9.0" |
Apologies for the misunderstanding. What I mean is that I had been using Starmapo's new version ahead of time, but I was still having errors. From what I can gather, this newly merged version is not much different from the one I was testing. I'll try to test it again sometime soon. |
@Geokureli |
That's great to hear, thanks for testing this for me! |
Some Android browsers can not type in text input fields. I leveraged
window.onTextInput
to detect text changes and refactored code to remove redundancies and improve performance. Some mobile targets also require touch detection. Fixes #262.I've tested typing and pasting text on desktop, mobile and web (both GeckoView and WebView browsers). These changes are also working with the latest versions of OpenFL and Lime.