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

Korean doesn't work with TSF #10

Open
nikitabuyevich opened this issue Aug 4, 2021 · 6 comments
Open

Korean doesn't work with TSF #10

nikitabuyevich opened this issue Aug 4, 2021 · 6 comments

Comments

@nikitabuyevich
Copy link
Contributor

When TSF is installed/enabled, Korean stops working (The behavior is unexpected and the composition string stops being rendered)

@ryancheung
Copy link
Owner

I've just #11 , the composition string is empty (filled with some empty characters?). Can you confirm that there's no other issue with Korean IME?
BTW, I've no idea of how Korean IME works.

@nikitabuyevich
Copy link
Contributor Author

Hey,

So if you just disable TSF (Set TextServicesLoader's ServicesInstalled function to return false, so it fallbacks on IMM32) it behaves correctly/as expected. Essentially the composition is build up and gets automatically inserted on certain criteria.

I don't know Korean either but here's an example you can run to test if it's working properly (Which is how it's currently working with just IMM32)

Spamming a on your keyboard.

  1. Type a on your keyboard, the composition should be filled with while the text input is empty.
  2. Type a on your keyboard again, the composition remains the same character as last time but now the text input should contain .
  3. If you keep pressing a on your keyboard you'll get the second scenario repeating.

Changing the composition

  1. Type a on your keyboard, the composition string should be filled with while the text input is empty.
  2. Type b on your keyboard, the composition string should change to while the text input is empty.
  3. Type c on your keyboard, the composition string should change to while the text input is empty.
  4. Type a on your keyboard, the composition string changes to while is inserted into the text input.

When I attempt the same scenario with TSF enabled, the composition string is always empty and everything is immediately inserted into the text input. I think what's supposed to happen is that OnEndComposition is called whenever the composition ends (like in scenario 4 when the user typed a and the composition finished building) and only then should the text input be inserted.

I have this project replicated in C++ but I'm getting different behavior where the composition string is being filled up properly but my text input remains empty.

Does that help? Let me know how I can help since I'm kind of stuck on where to take it from here.

@ryancheung
Copy link
Owner

There's no correct way to fix composion ends on every key press in TSF, I tried.

But, since we have IMM32 works, we could force to IMM32 for Korean IME. This could be a workaround at the moment.
What do you think?

@nikitabuyevich
Copy link
Contributor Author

Yeah it's a thought I had and something I tried without much success. I've created a new PR (#12) where we can play around with it to toggle it.

The issue is once I unregister and then attempt to register the TSF again, none of the sinks get hit again.

@ryancheung
Copy link
Owner

I tried with that approach yesterday. It has the issue you put. It seems not possible to be fixed. So I created https://github.com/ryancheung/ImeSharp/tree/option-to-force-disable-tsf

@waltdestler
Copy link

Hi, it looks like Korean isn't working regardless of whether TSF is enabled or not. The callbacks sent by ImeSharp do not provide the necessary info to properly update already-entered Korean characters.

As an example, here is the correct sequence of what should happen when pressing the DLEK keys on a keyboard:

D
ㅇ

DL
이

DLE
읻

DLEK
이다

Notice that when the K key is pressed, the previously-entered 읻 (DLE) character reverts to 이 (DL) and then the new character 다 (EK) is appended.

However, ImeSharp reports no change to the 읻 character once K is pressed. Here's the same sequence of keys and the corresponding characters as reported by ImeSharp:

D
ㅇ

DL
이

DLE
읻

DLEK
읻다

This happens regardless of whether tsfForceDisabled is true or not.

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

No branches or pull requests

3 participants