divvun / giellakbd-android

A fork of LatinIME (by Google for Android), targeting marginalised languages that also deserve first-class status on mobile operating systems.
Apache License 2.0
12 stars 6 forks source link

Deadkeys not working #17

Closed snomos closed 2 months ago

snomos commented 4 years ago

Instead I get a sequence of accent + base letter. Tested with latest beta (2.99.0) on a Samsung 9" pad.

2020-06-05 08 05 34

snomos commented 2 years ago

@albbas can you test this on an Android phone? Use the Divvun Dev Keyboards app.

snomos commented 1 year ago

@albbas ? ^^

albbas commented 1 year ago

Confirmed. Newly installed Divvun dev keyboard, Android version 13 on a Motorola Edge 30 pro (XT2201-1).

ena-fly commented 1 year ago

@albbas:
0.2.3 dev - Still a problem 0.2.1 - Works

@snomos Hi, do you still have this problem on 3.2.1 and 3.2.0?

zoomix commented 11 months ago

Is still still an issue with 0.2.4 of divvun-dev-keyboard?

albbas commented 11 months ago

Still a problem on 0.2.4 on my phone

zoomix commented 11 months ago

Dev notes:

Dead key transforms weren't exported for the android builds in kbdgen. They are now in this branch, https://github.com/divvun/kbdgen/commit/e692d14f5ae0bedf105946d3e1bd4bcbd220a391

However.

The latin:deadKey="True" params needs to be set on the dead keys for each language. That's done in kbdgen.. Or rather, it should be done in kbdgen.

app/src/main/res/xml/rowkeys_tsuutxina1.xml

<merge xmlns:latin="http://schemas.android.com/apk/res-auto">
    <switch>
        <case latin:keyboardLayoutSetElement="alphabetManualShifted|alphabetShiftLocked|alphabetShiftLockShifted">
            <Key latin:keySpec="ʼ" latin:keyHintLabel="1" latin:additionalMoreKeys="1" latin:moreKeys="q,Q" />
            <Key latin:keySpec="W" latin:keyHintLabel="2" latin:additionalMoreKeys="2" />
            <Key latin:keySpec="E"
                latin:keyHintLabel="3"
                latin:additionalMoreKeys="3"
                latin:moreKeys="Ë,É,È,Ê,Ẽ,Ē,Ẹ,Ė,Ǝ" />
...                
            <Key latin:keySpec="¯" latin:deadKey="True" />
        </case>
...

Run the kbdgen and then manually add the deadKey param for the "¯" key, and with the new transforms, the dead keys work.

Note!

When combining the the dead key with non specified characters, such as s - the keyboard crashes. Not sure how this used to be handled. Seeing as how the program explodes, I'm inclined to believe the kbdgen should be generating something more that it isn't right now.

zoomix commented 11 months ago

This is where the crash occurs if you combine ¯ with (for instance) s

https://github.com/divvun/giellakbd-android/blob/b4615f45796d670cb4d960c3d717b3845191290d/app/src/main/java/com/android/inputmethod/event/SoftDeadKeyCombiner.kt#L87

snomos commented 11 months ago

@zoomix:

When combining the the dead key with non specified characters, such as s - the keyboard crashes. Not sure how this used to be handled. Seeing as how the program explodes, I'm inclined to believe the kbdgen should be generating something more that it isn't right now.

The expected output is:

snomos commented 11 months ago

@zoomix deadkey data should be read from a json file, cf

https://github.com/divvun/giellakbd-android/blob/main/app/src/main/java/no/divvun/domain/Descriptor.kt

Not sure how the JSON file is handled in the Rust version of kbdgen, but here is the old Python code for generating the layout:

https://github.com/divvun/kbdgen-archived/blob/main/pysrc/kbdgen/gen/android.py#L269-L295

It is possible that deadkeys never were implemented correctly since the code is using transforms but that's at least a first step: see if the dead keys themselves actually work.

zoomix commented 11 months ago

Alrighty. Thanks!

I've published a new version of dev-divvun - 0.2.5. Looks like it's working to me.

Two things I noticed.

zoomix commented 11 months ago

I think I found the Tsuutʼina bug. 0.2.6 is building.

snomos commented 2 months ago

This is fixed.