-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Support IME events abstraction #7315
Comments
I would appreciate it if someone could respond quickly, as the issue I created in some other repositories went unanswered. |
related to #6213 I'm not sure if IME should be handled in the window/events, since you'll only want to do IME in a text input - correct me if I'm wrong, but I never used it any other way... So I'd rather see a solid base text input component, which gets re-used in other widgets. Shouldn't that be also part of the endeavour of writing the editor (dogfeeding solid, usable UI components)? On the other hand, handling IME on a lower level (window/events) would allow other UI implementations to also write custom IME support easily. How likely is that once Bevy offers a solid solution? |
In fact I was trying bevy_egui but found it has no IME support. I tried to add this functionality to it, and then found that there is no API to handle these events. |
If you want to have a quick discussion, btw, you might find that easier on the Discord! |
I have no knowledge of how IME works, but it looks like it needs to be enabled on winit with To get winit window:
that should give you the winit windows where you can enable IME. This is what would be currently needed, but it would make sense to improve that scenario with a quick PR that would do all that for you in a simple function. Once that's down, I suppose you should expect |
# Objective - Fix bevyengine#7315 - Add IME support ## Solution - Add two new fields to `Window`, to control if IME is enabled and the candidate box position This allows the use of dead keys which are needed in French, or the full IME experience to type using Pinyin I also added a basic general text input example that can handle IME input. https://user-images.githubusercontent.com/8672791/213941353-5ed73a73-5dd1-4e66-a7d6-a69b49694c52.mp4
What problem does this solve or what need does it fill?
To be honest, not having input method support can be seen as a bug, which even makes me discouraged from
bevy
. Whether it is a GUI integration made by someone else (such asbevy_egui
) or a GUI system made by ourselves, sooner or later it will have to deal with the problem of input methods. For users like us, GUI systems without input method support are not usable, so I hope we can take a small step in this regard by providing the ability to handle IME events with an abstract API.What solution would you like?
The definition of these events should probably be put in bevy_window/events.rs, and then we convert these events in the backend. For
winit
, the definition of these events can be found atwinit::event::ime
. Notice that we need to add methods that provide access towindow.set_ime_position
.What alternative(s) have you considered?
I guess you can only enter CJK characters by copy-pasting. I have to say it's very bad UX.
Additional context
Here is a pull request that adds IME support to
egui_winit
: emilk/egui#2046and a solution for web: emilk/egui#253
The text was updated successfully, but these errors were encountered: