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

Can't enter Korean/Chinese/Japanese in textboxes (IME support) #1778

Open
2 of 9 tasks
jmousy opened this issue Nov 30, 2020 · 9 comments
Open
2 of 9 tasks

Can't enter Korean/Chinese/Japanese in textboxes (IME support) #1778

jmousy opened this issue Nov 30, 2020 · 9 comments
Labels
ime Issues related to Input Method Editor text Issues relating to text rendering/input unimplemented Issues for functionality that hasn't been implemented yet

Comments

@jmousy
Copy link
Contributor

jmousy commented Nov 30, 2020

The original issue was about shortcut behavior in text fields (e.g. copy, paste) and CJK input. The shortcut behavior is now implemented and i'll leave this issue open for IME support.

  1. Currently Ruffle does not support Korean, Japanese, or Chinese input in any text boxes in AVM1/2.
  2. Ruffle does not support the "Right Alt" key (called "한/영" key in Korea) to switch between Korean and English.
  3. Ruffle does not copy or paste Korean/Japanese/Chinese text.

This issue will probably be tracked here: #277

IME is a feature that hasn't been implemented in a very long time, and i'd really like to see it implemented for multilingual users.

Thanks,

TODO

  • Basic IME Support (Desktop)
  • Desktop
  • Web (Self-hosted)
  • Korean support
  • Japanese support
  • Chinese support
  • Other languages support (?)
  • Language switch (like Right alt key)
  • Copy/Paste/Select text
@jmousy jmousy changed the title [web] There are some problems with text input boxes. There are some problems with text input boxes. Nov 30, 2020
@ousia
Copy link
Contributor

ousia commented Jan 23, 2021

I don’t know whether #2081 might fix this.

This is wrong in part, since I misunderstood something here. It will only fix issue 2.

Issue 1 might be fixed when #1862 is implemented.

@n0samu n0samu added text Issues relating to text rendering/input unimplemented Issues for functionality that hasn't been implemented yet labels Oct 6, 2022
@n0samu n0samu added input Issues relating to user input in Flash content and removed input Issues relating to user input in Flash content labels Mar 31, 2023
@jmousy
Copy link
Contributor Author

jmousy commented Jul 28, 2024

The original issue was about shortcut behavior in text fields (e.g. copy, paste) and CJK input. The shortcut behavior is now implemented and i'll leave this issue open for IME support.

@jmousy jmousy changed the title There are some problems with text input boxes. Can't enter Korean/Chinese/Japanese in textboxes (IME support) Jul 28, 2024
@kjarosh kjarosh added the ime Issues related to Input Method Editor label Feb 26, 2025
@kjarosh
Copy link
Member

kjarosh commented Mar 22, 2025

Implementation status:

@jmousy
Copy link
Contributor Author

jmousy commented Mar 23, 2025

Hello,
IME is a feature that many Asians need, and i'm so happy and grateful that you've taken an interest in it and started improve it.

I have questions about your work and future direction and leave a comment. (I apologize if it seems like i'm trying to pressure you,):

Is there any chance that IME will be supported in the future, not only on the desktop, but also in self-hosted web environments? Or would technical difficulties prevent it from being implemented at this point?

I also found that for some specialized flash games (AVM2), as shown below, you can enter Korean text even in the current Nightly version.
The input interface seemed to work fine, although the combination characters contained in Hangul were not combined correctly (e.g., the backspace character).

for example,

When you try to type '가', you need to type 'ㄱ' and 'ㅏ'. The behavior should be 'ㄱ' -> '가', but it is entered as 'ㄱ' -> 'ㄱ가'.
Similarly, when you try to use the 'ㅇ' base for something like '강', it is entered as 'ㄱ' -> 'ㄱ가' -> 'ㄱ가강'.

Image

Sample File: 흥해라편의점.zip

If this could be fixed, would it be possible to have Korean input in some Flash at this time? Or is this something that would need to be structurally redesigned?

Regards,

@kjarosh
Copy link
Member

kjarosh commented Mar 23, 2025

IME is a feature that many Asians need, and i'm so happy and grateful that you've taken an interest in it and started improve it.

I'm glad you're happy! It would be very helpful if you tested IME as its support is being implemented to catch bugs early before we enable it by default :)

Is there any chance that IME will be supported in the future, not only on the desktop, but also in self-hosted web environments? Or would technical difficulties prevent it from being implemented at this point?

The reason I started with desktop it that it's very easy to integrate. It's far more difficult on web. IME basically consists of two parts: (1) behavior in Flash Player, and (2) integration with the environment. The (2) part is trivial on desktop, so I can make sure that (1) works properly before trying to implement (2) on web.

When you try to type '가', you need to type 'ㄱ' and 'ㅏ'. The behavior should be 'ㄱ' -> '가', but it is entered as 'ㄱ' -> 'ㄱ가'.
Similarly, when you try to use the 'ㅇ' base for something like '강', it is entered as 'ㄱ' -> 'ㄱ가' -> 'ㄱ가강'.

First things first, I'm sorry if I say something wrong about inputting Korean, as I don't know any CJK languages.

I've tried inputting and using Korean input, Dubeolsik keyboard. When IME is enabled in Ruffle, I can type r,k,Enter to get , or r,k,d,Enter to get . When IME is disabled, I cannot type any Korean character, it's always Latin.

Did you have IME enabled in Ruffle when trying to type these characters? If not, it's very likely it's a bug in the software you're using to input Korean.

Edit: unless you meant web, in which case it's possible everything's buggy due to how we fake text input. I'd expect it to change when we start implementing IME there.

If this could be fixed, would it be possible to have Korean input in some Flash at this time? Or is this something that would need to be structurally redesigned?

Currently there are 2 options:

  1. you can enable IME in Ruffle and input those characters (but without preview yet),
  2. you can use some software that generates those characters as pressed keys without IME (I don't know any, sorry).

Edit: for web it's more complicated and I don't think there's a reliable way of inputting Korean other than pasting the text.

@kjarosh
Copy link
Member

kjarosh commented Mar 23, 2025

Edit: unless you meant web, in which case it's possible everything's buggy due to how we fake text input. I'd expect it to change when we start implementing IME there.

This should help: #19896

@jmousy
Copy link
Contributor Author

jmousy commented Mar 29, 2025

Thank you for your detailed answer, it clarified a lot of things I was wondering and helped me.

After enabling the Input Method (experimental) based on Ruffle (2025-03-28 Nightly) in the desktop app, I could see that the Korean characters were entered normally as shown below:

Image

However, the cursor doesn't seem to be at the end of the text I'm typing, but the position of the cursor doesn't interfere with my typing.

Additionally, i've noticed that Korean input still doesn't work in some text boxes written in AVM1 on desktop Ruffle.
Unlike the AVM2 flash example above, no text was being entered.

Image

Below is the result for Adobe Flash Player:

Image

Test swf: avm1_input.zip

I'm not sure how helpful this will be, but I figured it could be a test case, so I'm commenting :)

@kjarosh
Copy link
Member

kjarosh commented Mar 29, 2025

However, the cursor doesn't seem to be at the end of the text I'm typing, but the position of the cursor doesn't interfere with my typing.

Unfortunately, I cannot reproduce that, the cursor is always at the right place for me :/ The cursor position is calculated by the input method, and then it just tells Ruffle to place a caret at the position.

What input method are you using? What characters are you typing? Does it happen all the time?

Additionally, i've noticed that Korean input still doesn't work in some text boxes written in AVM1 on desktop Ruffle.

Actually, Korean input still works there, but the font just doesn't have the right characters, so they are not displayed. It's a different issue related to missing a proper character fallback behavior in Ruffle.

+ Flash disables IME when some characters are missing, but that's a more advanced behavior

I'm not sure how helpful this will be, but I figured it could be a test case, so I'm commenting :)

That's very helpful, thank you! You might also want to focus on some behaviors related to inputting text with IME, e.g. a text field misbehaving when using IME (placeholders not working properly, character limit does not work, etc.).

@jmousy
Copy link
Contributor Author

jmousy commented Mar 30, 2025

Unfortunately, I cannot reproduce that, the cursor is always at the right place for me :/ The cursor position is calculated by the input method, and then it just tells Ruffle to place a caret at the position. What input method are you using? What characters are you typing? Does it happen all the time?

Image

Yes, this is always reproduced and happens even when entering incomplete characters in Korean input.

One peculiarity is that when you paste text using Ctrl+V, the cursor appears normally on the far right.

  • Example text: '안녕하세요'

Result:
Image

I'm on Windows 11 24H2 and using Windows' default Korean keyboard.

For example, to type "강", you need to type r, k, and d on the keyboard; when you type r, you should see an "ㄱ". Since the initial letter has already been typed, the cursor (|) on the screen from this point on should show 'ㄱ|' instead of '|ㄱ'.

  • '*' is cursor
  • Keystroke order from top to bottom
Key input (en) Key input (ko) Result (current) Result (expect)
r *ㄱ ㄱ*
k *가 가*
d *강 강*
s 강*ㄴ 강ㄴ*
e 강ㄴ*ㄷ 강ㄴㄷ*

However, the behavior i've seen in that flash file, and i still need to find other examples in other flash files.

As IME features are improved in the future, i plan to check out more test cases, including languages other than Korean :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ime Issues related to Input Method Editor text Issues relating to text rendering/input unimplemented Issues for functionality that hasn't been implemented yet
Projects
None yet
Development

No branches or pull requests

4 participants