slint-ui / slint

Slint is a declarative GUI toolkit to build native user interfaces for Rust, C++, or JavaScript apps.
https://slint.dev
Other
16.93k stars 565 forks source link

Can't input Korean characters in Windows 11 #1706

Closed teminian closed 1 year ago

teminian commented 1 year ago

Slint version: 0.3.0 OS: Windows 11, Skia (no OpenGL) Sypmtom: I can't input Korean characters in Windows, even though my keyboard layout is Korean and I can input Korean characters without issues in other applications. More exactly, the IME doesn't change from alphabet input mode to Korean input mode when I try to change the mode when Korean IME is in use(Korean IME provides two input modes, English and Korean), which I didn't experience this in 0.2.X.

The only way I can input Korean is copy-and-paste Korean text from other applications.

Thank you in advance for for your cooperation.

tronical commented 1 year ago

Indeed, input method support is currently limited to IME commit events, which is by far insufficient.

Odd that there was a difference in experience in 0.2.x, but this may have been due to a change in the underlying winit library. Either way we need to implement the correct IME event handling and hints. I'll prioritise that.

tronical commented 1 year ago

Ok, I've got a PR up for basic IME support with Skia/winit. I've tested with Japanese and Korean IME on macOS and Windows. It has some caveats in terms of interaction with the mouse for example, but I think it's a reasonable start. Once this is merged I'll let you know. Would love to get your feedback then :)

I do also plan on implementing this for the Qt side.

tronical commented 1 year ago

Hi @teminian - I've merged the initial input method support. Could you give it a try and see if you spot anything out of the ordinary with Korean?

teminian commented 1 year ago

I tested new master and it works! And even more, this master fixes two more issues,

  1. https://github.com/slint-ui/slint/issues/1138 , which was also reported by me
  2. I can see keyboard cursor(or caret) - it didn't appear, though I didn't report here

Here's the screenshot for you. image

I think you can safely close and mark it as resolved.

tronical commented 1 year ago

Thanks for checking - much appreciated!!

I’ll close this after implementing the Qt side. The other issue with the hanging characters is indeed fixed by the Skia renderer. It’s still there with the femtovg one. Need to tackle this when adding text selection to the software Renderer and then use the same text layout code.