keymanapp / keyman

Keyman cross platform input methods system running on Android, iOS, Linux, macOS, Windows and mobile and desktop web
https://keyman.com/
Other
403 stars 112 forks source link

bug(mac): generated backspace of SMP character corrupts text #1643

Closed darcywong00 closed 7 months ago

darcywong00 commented 5 years ago

When Keyman processes a keystroke that replaces the previous SMP character with a new one, it replaces only half of the previous character, leaving the text corrupted. This will produce unexpected results that may vary depending on the app being used.

Note that this only occurs for compliant apps, like Pages or Stickies. This can be reproduced with the Brahmi Inscript keyboard because it outputs the same characters as the one reported by the original user.

Reported by @sewhite on the community site using Keyman 11.0.220

A keyboard I’ve made that works fine in Windows is not working well in Mac OS. I’m working with the Brahmi script, (U+11000…U+1107F) which has one symbol for free standing vowels and a different symbol that combines with a preceding consonant.

My code says this:


store(cons) ‘𑀓𑀔𑀕𑀖𑀗𑀘𑀙𑀚𑀛𑀜𑀝𑀞𑀟𑀠𑀡𑀢𑀣𑀤𑀥𑀦𑀧𑀨𑀩𑀪𑀫𑀬𑀭𑀮𑀯𑀰𑀱𑀲𑀳𑀴𑀵𑀶𑀷’
begin Unicode > use(main)

group(main) using keys

c combining vowels any(cons) + [K_A] > index(cons,1) ‘𑀸’ c sign aa


>On Mac, the rule that makes the vowel be the combining form if a consonant precedes it is not working, I always get the freestanding vowel form.
>
>My entire KMN file: https://drive.google.com/file/d/1H35C9TcmqGQsapyWM_uzrNraxZ13oF2m/view?usp=sharing
mcdurdin commented 5 years ago

I suggest we address this with Keyman Core refactor rather than trying to fix the existing core.

sewhite commented 5 years ago

KMN file in attached zip. brahmi.zip

mcdurdin commented 5 years ago

See also https://community.software.sil.org/t/unusual-behavior-in-several-macos-apps-when-using-a-keyman-keyboard/1917/2

darcywong00 commented 3 years ago

Is this addressed in 15.0 with #5012?

I just got an email from a user asking if there's a workaround in the meantime.

mcdurdin commented 3 years ago

Is this addressed in 15.0 with #5012?

Yes, that's the plan.

I just got an email from a user asking if there's a workaround in the meantime.

Not really, sorry.

sgschantz commented 9 months ago

This still exists after the move to Keyman Core. I created a kmp file for the attached kmn, and was able to reproduce the issue in several compliant apps like Pages, TextEdit and Stickies.

It is not a problem in non-compliant apps because they are unable to read the context from the application. So for compliant apps Keyman is misleading Core by passing an incorrect context string when the context read from the app contains SMP characters.

sgschantz commented 8 months ago

This is actually not caused by setting the context incorrectly. This only occurs for compliant apps when inserting and replacing a SMP character.