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

Only show on-screen-keyboard and IME when editing text #3362

Merged
merged 6 commits into from
Sep 19, 2023
Merged

Only show on-screen-keyboard and IME when editing text #3362

merged 6 commits into from
Sep 19, 2023

Conversation

Barugon
Copy link
Contributor

@Barugon Barugon commented Sep 19, 2023

Allow IME if PlatformOutput::text_cursor_pos is Some.

Copy link
Owner

@emilk emilk left a comment

Choose a reason for hiding this comment

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

This looks much better! How have you tested it?

@Barugon
Copy link
Contributor Author

Barugon commented Sep 19, 2023

I've tested it on a PinePhone Pro (Phosh).

[edit] Tested on regular GNOME desktop too.

It seems to be a bit expensive to call Window::set_ime_allowed, so I added some code to only call it when the state of text_cursor_pos changes.

@Barugon
Copy link
Contributor Author

Barugon commented Sep 19, 2023

On Phosh, the keyboard pops up when a text widget is focused and it's hidden when the text widget looses focus.

@emilk emilk added eframe Relates to epi and eframe egui-winit porblems related to winit labels Sep 19, 2023
@emilk
Copy link
Owner

emilk commented Sep 19, 2023

Nice!

@emilk emilk changed the title Better place to call set_ime_allowed Only show on-screen-keyboard and IME when editing text Sep 19, 2023
@emilk emilk merged commit c07394b into emilk:master Sep 19, 2023
19 of 20 checks passed
@Barugon Barugon deleted the set_ime_allowed branch September 19, 2023 16:24
@emilk emilk mentioned this pull request Nov 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
eframe Relates to epi and eframe egui-winit porblems related to winit
Projects
None yet
2 participants