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

Support Android browser text input #263

Open
wants to merge 4 commits into
base: dev
Choose a base branch
from

Conversation

DigiEggz
Copy link
Contributor

@DigiEggz DigiEggz commented Dec 21, 2023

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.

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.
@DigiEggz
Copy link
Contributor Author

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.

@Geokureli
Copy link
Member

@DigiEggz have you seen the new FlxInputText added to core flixel 5.9.0 (unreleased)?
Does it work better for android devices?

@DigiEggz
Copy link
Contributor Author

DigiEggz commented Aug 9, 2024

@DigiEggz have you seen the new FlxInputText added to core flixel 5.9.0 (unreleased)? Does it work better for android devices?

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.

@Geokureli
Copy link
Member

@DigiEggz have you seen the new FlxInputText added to core flixel 5.9.0 (unreleased)? Does it work better for android devices?

Is this one based on the one Starmapo ported or is it something entirely new?

Uh... both? Starmapo made something entirely new based off of their own implementation and the existing flixel-ui implementation

@DigiEggz
Copy link
Contributor Author

DigiEggz commented Aug 9, 2024

@DigiEggz have you seen the new FlxInputText added to core flixel 5.9.0 (unreleased)? Does it work better for android devices?

Is this one based on the one Starmapo ported or is it something entirely new?

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.

@Geokureli
Copy link
Member

Geokureli commented Aug 9, 2024

I had tried switching to their version a month or so ago (available as a library) and I experienced some input issues

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"
HaxeFlixel/flixel#3219

@DigiEggz
Copy link
Contributor Author

DigiEggz commented Aug 9, 2024

I had tried switching to their version a month or so ago (available as a library) and I experienced some input issues

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" HaxeFlixel/flixel#3219

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.

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.

Chromium browsers on Android only shows numeric input
2 participants