compose-multiplatform
compose-multiplatform copied to clipboard
Hotkeys when typing Korean in a TextField in macOs on Desktop Issue
Describe the bug I am developing a Desktop Application, but unlike Windows, when I enter Korean language in TextField on macOs, if I use shortcut keys such as Select All (command + a) and Copy (command + c), they are not applied at once, but I have to press them twice. (* English, numbers, etc. can be done at once.)
Affected platforms
- Desktop (macOS)
Versions
- Kotlin version*: 1.9.0
- Compose Multiplatform version*: 1.6.1
- OS version(s)* (required for Desktop and iOS issues): macOS Sonoma 14.4.1
- JDK (for desktop issues): 17
Screenshots
When viewing the gif, in English, the text is not underlined.
In Korean, the first time you press the shortcut(command + a) after the underline appears, the shortcut is not applied and the underline disappears.
If you press the shortcut(command + a) again, it will be applied.
Seems like duplicate of #3497
I thought it was a JDK version issue, so I tried changing the version, but unfortunately, the same issue occurred. The difference with issue #3497 is that in my case, the [Cmd+C/V/X shortcut] works fine if I type it multiple times. However, it is quite inconvenient that I have to type the shortcut twice for it to work.
This is unrelated to #3497 but is a bug in Java/Swing. The exact same behavior reproduces with a JTextField.
It seems AWT is just not sending us the KEY_DOWN event corresponding to cmd-a when "composing" the last character. Below is the log of events when pressing, for example g, h, cmd-a
java.awt.event.InputMethodEvent[INPUT_METHOD_TEXT_CHANGED, "" + "ㅎ", 0 characters committed, caret: TextHitInfo[0T], visible position: TextHitInfo[-1T]] on canvas0
java.awt.event.KeyEvent[KEY_RELEASED,keyCode=71,keyText=G,keyChar='ㅎ',keyLocation=KEY_LOCATION_STANDARD,rawCode=0,primaryLevelUnicode=0,scancode=0,extendedKeyCode=0x0] on canvas0
java.awt.event.InputMethodEvent[INPUT_METHOD_TEXT_CHANGED, "" + "호", 0 characters committed, caret: TextHitInfo[0T], visible position: TextHitInfo[-1T]] on canvas0
java.awt.event.KeyEvent[KEY_RELEASED,keyCode=72,keyText=H,keyChar='ㅗ',keyLocation=KEY_LOCATION_STANDARD,rawCode=0,primaryLevelUnicode=0,scancode=0,extendedKeyCode=0x0] on canvas0
java.awt.event.KeyEvent[KEY_PRESSED,keyCode=157,keyText=⌘,keyChar=Undefined keyChar,modifiers=⌘,extModifiers=⌘,keyLocation=KEY_LOCATION_LEFT,rawCode=0,primaryLevelUnicode=0,scancode=0,extendedKeyCode=0x9d] on canvas0
java.awt.event.InputMethodEvent[INPUT_METHOD_TEXT_CHANGED, "" + "호", 0 characters committed, caret: TextHitInfo[0T], visible position: TextHitInfo[-1T]] on canvas0
java.awt.event.InputMethodEvent[INPUT_METHOD_TEXT_CHANGED, "호" + "", 1 characters committed, caret: TextHitInfo[0L], visible position: TextHitInfo[0L]] on canvas0
java.awt.event.KeyEvent[KEY_RELEASED,keyCode=65,keyText=A,keyChar='a',modifiers=⌘,extModifiers=⌘,keyLocation=KEY_LOCATION_STANDARD,rawCode=0,primaryLevelUnicode=0,scancode=0,extendedKeyCode=0x41] on canvas0
java.awt.event.KeyEvent[KEY_RELEASED,keyCode=157,keyText=⌘,keyChar=Undefined keyChar,keyLocation=KEY_LOCATION_LEFT,rawCode=0,primaryLevelUnicode=0,scancode=0,extendedKeyCode=0x9d] on canvas0
Please check the following ticket on YouTrack for follow-ups to this issue. GitHub issues will be closed in the coming weeks.