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

basic IME support rebase #1858

Open
wants to merge 31 commits into
base: master
Choose a base branch
from

Conversation

KentaTheBugMaker
Copy link

@KentaTheBugMaker KentaTheBugMaker commented May 20, 2023

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

  • 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

  • windows MS-IME

Phase 3 draw underline and cursor

behavior

2022-12-05.23-27-59.mp4

test

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

  • 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.

@AllenDang
Copy link

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

@hecrj hecrj added this to the 0.12.0 milestone May 23, 2023
@hecrj
Copy link
Member

hecrj commented May 23, 2023

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

I will take a look at this by then!

@rhysd
Copy link

rhysd commented Aug 11, 2023

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.

test.mov
  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.

@hecrj hecrj modified the milestones: 0.13.0, 0.14.0 Sep 9, 2023
@tingfeng-key
Copy link

image

run iced-ime_adavanced_text\examples\todos

@KentaTheBugMaker
Copy link
Author

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.

@tingfeng-key
Copy link

image
It's normal, thank you for your efforts

@bajie-git
Copy link

bajie-git commented Nov 17, 2023

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"

@KentaTheBugMaker
Copy link
Author

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.

@Taiyangqihuo
Copy link

Awesome work!

@Drodofsky
Copy link

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!

@KentaTheBugMaker
Copy link
Author

@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?

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

Successfully merging this pull request may close these issues.

IME input method on iced application (fcitix on linux)
8 participants