iced icon indicating copy to clipboard operation
iced copied to clipboard

basic IME support rebase

Open KentaTheBugMaker opened this issue 1 year ago • 18 comments

General

This PR fix #979,#1544. iced ime support was broken due to winit 0.27 update . This PR add event to fit new winit IME event model and introduce new event support for text_input.

how to test

download app from my repo https://github.com/KentaTheBugMaker/iced_text_input_sample/

Phase 1 : Can we input CJK characters?

tested on

  • [x] windows MS-IME

Phase 2 : Candidate position is near the TextInput?

You maybe failed to reproduce due to IME version. candidate positon on X11 require LibX11 1.8.2 or above.

Wayland requirement.

  • input_method_v2 popups

tested on

  • [x] windows MS-IME

Phase 3 draw underline and cursor

behavior

https://user-images.githubusercontent.com/48007646/205664366-ea71ddaf-a778-4f1a-9d0e-1b5cb557e70c.mp4

test

not required. We render underline and cursor correctly if winit correctly report it.

  • [x] windows

Note

I don't have a macos device, so if you notice any problems, macos users please fix them.

Some tests were done by other users. but Iced rework enforce me to reimplement completely. Therefore old tests are not compatible with this version.

feel free to reimplement this.

KentaTheBugMaker avatar May 20 '23 15:05 KentaTheBugMaker

I tracked this pr daily, hope to see it will be merged into main brach some day.

AllenDang avatar May 21 '23 15:05 AllenDang

Work related to IME is slated around the 0.12 release. See the ROADMAP.

I will take a look at this by then!

hecrj avatar May 23 '23 00:05 hecrj

Thank you for working on this. This is a mandatory feature for CJK users.

I tried this branch on macOS and I found one small issue. When some character was already input before a cursor, the insert position of IME candidates was a bit wrong.

https://github.com/iced-rs/iced/assets/823277/ed7222b2-943e-4c85-8ca2-ecaa71762fe8

  1. Enable Japanese IME
  2. Type aiueo and Return
  3. Text あいうえお is inserted
  4. Type kakikukeko
  5. Expected the candidate かきくけこ was positioned at after お, but it was actually positioned before お

After selecting the candidate, the text かきくけこ is inserted at correct position. So only the position of IME candidate is wrong.

rhysd avatar Aug 11 '23 16:08 rhysd

image

run iced-ime_adavanced_text\examples\todos

tingfeng-key avatar Nov 15 '23 12:11 tingfeng-key

We can't measure width of IME candidate window. So some overflow may occur but it seems to too large overflow. We offset candidate window when text content overflow the TextInput widget.

KentaTheBugMaker avatar Nov 16 '23 02:11 KentaTheBugMaker

image It's normal, thank you for your efforts

tingfeng-key avatar Nov 16 '23 04:11 tingfeng-key

image

The default windows input method can be used normally, but the "Sogou input method" still has problems, and the console will prompt: "libpng warning: iCCP: known incorrect sRGB profile"

bajie-git avatar Nov 17 '23 01:11 bajie-git

iced now using winit 0.28.6 fork. therefore you need to test winit ime example. if same problem ocurred we can't fix this problem.

KentaTheBugMaker avatar Nov 17 '23 01:11 KentaTheBugMaker

Awesome work!

Taiyangqihuo avatar Jun 25 '24 10:06 Taiyangqihuo

Hi, I understand that IME is scheduled for a later release in the roadmap, but it is a crucial feature for me and many others. Please consider moving IME to an earlier release. What is still needed before this feature can be merged? Thank you for the incredible work!

Drodofsky avatar Jul 12 '24 21:07 Drodofsky

@hecrj IME support is a fundamental feature for non-European users. What's blocking this PR ? or We need to make some RFC for IME?

KentaTheBugMaker avatar Jul 28 '24 13:07 KentaTheBugMaker