rust-windowing / rust-windowing/winit
Add IME support for Web (WASM)
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 6.2k
- Forks
- 1.3k
- Avg merge
- 2d 19h
- Merged PRs (30d)
- 9
Description
Description
Currently, IME input is not supported on Web (WASM) because the canvas element cannot receive CompositionEvent.
In egui, this limitation is worked around by adding a hidden input element to capture text input and then forwarding the events. (ref) While this approach works, it is quite hacky. I also tried implementing a patch for winit in the past (example commit), but found it difficult to make the same mechanism work reliably in fullscreen mode.
Another possible direction is to use the EditContext API (ref), which seems to provide a cleaner solution. However, at the moment, support is limited to Chromium-based browsers, so adopting it right now may be premature.
My opinion is that we should prepare a straightforward implementation based on the EditContext API and wait for broader browser support in the future.
If this proposal sounds acceptable, I would be happy to work on a pull request to add IME support for Web (WASM). What do you think?
Relevant platforms
Web
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the existing Web (WASM) input handling and the EditContext API documentation linked in the issue, along with the egui and winit examples. Done means adding reliable IME support for Web (WASM), including composition events, while accounting for fullscreen behavior and browser support.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust, wasm
- Domain
- web-dev
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100