~eliasnaur/gio#116: 
Samsung Default Keyboard cannot type in Android Gio Editor Widget

~jwhett and I discovered that he can't type in Gio applications (specifically the text editor) running on his Galaxy S20 by default. He is able to type punctuation and numbers (3-9 and 0, but not 1 and 2), but no letters.

We tracked this problem through the gio codebase by adding log statements and rebuilding, and we still didn't get any key event for letters (we were testing with a) even here:

https://git.sr.ht/~eliasnaur/gio/tree/master/app/internal/window/GioView.java#L80

I guess the inference is that whatever is going wrong is even deeper in the Android integration than that java file, though I know very little about how it works beyond that point.

We were able to switch from the Samsung default keyboard to the Google keyboard, and it works with the Google one. However, the power of defaults means that I suspect many Galaxy-owning users will encounter this problem.

I'm attaching some of logcat output mostly as an example of the characters that did work. You can see that here. We tested both with the gophers example and another app, though only the other app's logs are included here.

I'd be happy to try to dig further, but I'd appreciate any thoughts on how to do so.

Cheers!

Status
REPORTED
Submitter
~whereswaldon
Assigned to
No-one
Submitted
8 months ago
Updated
a month ago
Labels
No labels applied.

~eliasnaur 8 months ago

Gio is using a legacy interface to the Android IME, which is not supported by all keyboard. I'm going to work on it soon for the Tailscale Android client. See also #9, which I'm going to close in favour of this one.

~eliasnaur closed duplicate ticket #9 8 months ago

Cloud 2 months ago · edit

First of all thanks for this excellent project.

I found that text fields only support the system’s own English IME on all platforms: iOS/Android/macOS/Windows. I think this feature has a high priority. Unfortunately, I don't have much experience in GUI development.

Thanks again for your hard work.

~whereswaldon 2 months ago

FWIW, I intend to work on this soon. However, it's a complex widget and it needs to work for both iOS and Android, so it will take some time to get right.

~whereswaldon 2 months ago

Just wanted to drop by with an update. I experimented with this over the weekend, and I found an approach that seems promising on the Android side. I don't have a full PoC yet, but I hope to soon.

I'm essence, we can gain a ton of text input features by creating an invisible EditText widget for each gio window and subscribing to updates to it's state. That saves us from needing to implement an entire editor in gio core, and we can instead focus on translating the changes to that editor's state into events.

~inkeliz 2 months ago*

I think it's closer to what Gio already does for WASM. For WASM there's an invisible HTML Input, which Gio listen changes and erase the content. Seems that the idea is almost the same, I think it'll work.

~eliasnaur 2 months ago

On Mon Oct 26, 2020 at 15:02, ~whereswaldon wrote:

Just wanted to drop by with an update. I experimented with this over the weekend, and I found an approach that seems promising on the Android side. I don't have a full PoC yet, but I hope to soon.

I'm essence, we can gain a ton of text input features by creating an invisible EditText widget for each gio window and subscribing to updates to it's state. That saves us from needing to implement an entire editor in gio core, and we can instead focus on translating the changes to that editor's state into events.

It's a good idea, but unlike in the browser I don't think you need the heavy-handed EditText widget hack. There's Editable[0] and an implementation[1] in the standard library that you can re-use for the heavy work of interfacing with the input method. I believe those are what Flutter uses and what I'd start with.

[0] https://developer.android.com/reference/android/text/Editable [1] https://developer.android.com/reference/android/text/SpannableStringBuilder

Elias

~eliasnaur referenced this from #182 a month ago

Register here or Log in to comment, or comment via email.