rust-windowing / rust-windowing/winit

Add IME support for Web (WASM)

Open
#4,424 4 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

DS - web S - enhancement
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.