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 mapping #204

Merged
merged 1 commit into from
Oct 4, 2024
Merged

Basic IME mapping #204

merged 1 commit into from
Oct 4, 2024

Conversation

EReeves
Copy link
Contributor

@EReeves EReeves commented Aug 24, 2023

Fixes #145

This is enough for my needs, but FYI:

  • Ime::Disabled just maps to Event::CompositionEnd with an empty string for text. You could capture Ime::Preedit as state to handle it that way. I don't know where best to add the state.

src/systems.rs Outdated
match ev {
Ime::Preedit {
window,
value: _,
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't we also push a CompositionUpdate event with this value right after pushing CompositionStart?

(looking at the reference implementation at https://github.com/emilk/egui/blob/2bc2fb9c393bbbfc4832a35af1c100bc4ea48719/crates/egui-winit/src/lib.rs#L301)

Copy link
Contributor Author

@EReeves EReeves Oct 7, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good to me! I read through the reference and all code that uses the event. The event is used by TextEdit to preview text before it's committed by the IME. It should also be added for the sake of completion.

I added it here: 40e4236

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for forgetting to comment on this again, I feel really bad for neglecting this PR for several releases. The last question I want to ask is if there is a reason why we don't align our implementation to the reference one completely.

I haven't had a chance to test it myself and to understand if there's really any difference in behaviour, but I guess I'd feel safer if we just adopted exactly the same logic.

@vladbat00
Copy link
Owner

Hey! Thank you for the PR and apologies for taking a while to review it. Looks good to me in general, left 1 comment about the Ime::Preedit event though

@vladbat00 vladbat00 merged commit 4b6e961 into vladbat00:main Oct 4, 2024
39 checks passed
vladbat00 added a commit that referenced this pull request Oct 4, 2024
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.

IMEs not working
3 participants