[GH-ISSUE #4338] [Bug] Players of Korean, Japanese and Chinese can't type in chat or any text box: no input method (IME) events are handled #1284

Closed
opened 2026-11-02 15:45:41 +07:00 by bsakaguchi · 4 comments
Owner

Originally created by @Perdume on GitHub (Oct 30, 2026).
Original GitHub issue: https://github.com/horizon-rust/horizon/issues/4338

What happens

A player whose language needs an input method (Korean, Japanese, Chinese) can't type their language in chat, signs,
books, anvils, the creative search or any other text box. The window never asks the OS for an input method, and no
text box reads text that comes from one.

On Windows 11 with the Microsoft Korean IME, pressing the Han/Eng key in the game has no effect: the keys are typed
as Latin letters, so Hangul mode can't be entered at all (tested on the stock client, nightly-2026-10-30-ba6344a).

Vanilla Java Edition lets these players type normally, so this is a gap in the "plays exactly like vanilla" rule,
and these players can't chat in their language.

Where it comes from

Checked on main at e84a47c. game.rs and game/chat.rs are the same in nightly-2026-10-30-ba6344a, the version I ran.

  • crates/horizon-client/src/game.rs: resumed creates the window with Window::default_attributes() and never
    calls Window::set_ime_allowed. window_event has no arm for WindowEvent::Ime.
  • Searching every .rs file of the repository (without third_party/) finds no set_ime_allowed,
    set_ime_cursor_area or WindowEvent::Ime.
  • Every text box takes its text only from KeyEvent::text of WindowEvent::KeyboardInput: 16 call sites in 9 files
    (rg 'event\.text|\.text\.as_deref\(\)' crates/horizon-client/src): game.rs, game/chat.rs,
    game/sign_edit.rs, game/books.rs, game/command_blocks.rs, game/recipe_book.rs, game/startup_menu.rs,
    game/lan_screen.rs, game/native_panel.rs.
  • winit 0.30.13 (the version Horizon uses) documents Window::set_ime_allowed: "IME is not allowed by
    default", and "when IME is not allowed, the window won't receive Ime events, and will receive KeyboardInput
    events for every keypress instead". So the window gets the raw keys, never the syllable an input method composes
    from them.

Vanilla reference

Vanilla 26.3's client handles input-method composition: KeyboardHandler.textEditing and
KeyboardHandler.submitPreeditEvent, with PreeditEvent (fromSdlTextEditing, toFormattedText) for the text
that is still being composed. The port ledger already lists them as missing in #3518:

  • KeyboardHandler.submitPreeditEvent: "no IME preedit event reaches any screen"
  • KeyboardHandler.textEditing: "no IME composition"
  • PreeditEvent.fromSdlTextEditing: "no IME events are handled"
  • PreeditEvent.toFormattedText

I have not read these against the pinned bytecode with tools/rea_vanilla.py; whoever fixes this should.

Suggested direction (not a patch)

  1. Allow IME only while a text field has focus, and turn it off otherwise. I expect this keeps movement keys
    unaffected by the player's input mode; I have not tested that.
  2. Handle WindowEvent::Ime: Commit(text) goes down the same path as KeyEvent::text today;
    Preedit(text, cursor) is drawn at the caret, as vanilla's PreeditEvent is. Without the preedit, text appears
    only when the IME commits it, one syllable behind the keys in Korean.
  3. Report the caret rectangle with set_ime_cursor_area so the candidate window opens at the text box.

One shared text-input entry point would avoid changing the 16 call sites one by one. A native mod can't fix this
stably: no hook point covers window events or IME, so the fix belongs in the client.

Environment

  • Horizon: nightly-2026-10-30-ba6344a (launcher 0.2.0)
  • OS: Windows 11 Pro 10.0.26200
  • Input method: Microsoft IME (Korean)
  • #3518 (port gaps: Screens, HUD and client packets) lists the four vanilla methods above.
  • No open or closed issue found for "IME", "input method", "Korean", "composition", "pinyin" or "Japanese input".

Suggested label: bug.

Originally created by @Perdume on GitHub (Oct 30, 2026). Original GitHub issue: https://github.com/horizon-rust/horizon/issues/4338 ## What happens A player whose language needs an input method (Korean, Japanese, Chinese) can't type their language in chat, signs, books, anvils, the creative search or any other text box. The window never asks the OS for an input method, and no text box reads text that comes from one. On Windows 11 with the Microsoft Korean IME, pressing the Han/Eng key in the game has no effect: the keys are typed as Latin letters, so Hangul mode can't be entered at all (tested on the stock client, nightly-2026-10-30-ba6344a). Vanilla Java Edition lets these players type normally, so this is a gap in the "plays exactly like vanilla" rule, and these players can't chat in their language. ## Where it comes from Checked on main at e84a47c. `game.rs` and `game/chat.rs` are the same in nightly-2026-10-30-ba6344a, the version I ran. - `crates/horizon-client/src/game.rs`: `resumed` creates the window with `Window::default_attributes()` and never calls `Window::set_ime_allowed`. `window_event` has no arm for `WindowEvent::Ime`. - Searching every `.rs` file of the repository (without `third_party/`) finds no `set_ime_allowed`, `set_ime_cursor_area` or `WindowEvent::Ime`. - Every text box takes its text only from `KeyEvent::text` of `WindowEvent::KeyboardInput`: 16 call sites in 9 files (`rg 'event\.text|\.text\.as_deref\(\)' crates/horizon-client/src`): `game.rs`, `game/chat.rs`, `game/sign_edit.rs`, `game/books.rs`, `game/command_blocks.rs`, `game/recipe_book.rs`, `game/startup_menu.rs`, `game/lan_screen.rs`, `game/native_panel.rs`. - winit 0.30.13 (the version Horizon uses) documents `Window::set_ime_allowed`: "IME is **not** allowed by default", and "when IME is not allowed, the window won't receive `Ime` events, and will receive `KeyboardInput` events for every keypress instead". So the window gets the raw keys, never the syllable an input method composes from them. ## Vanilla reference Vanilla 26.3's client handles input-method composition: `KeyboardHandler.textEditing` and `KeyboardHandler.submitPreeditEvent`, with `PreeditEvent` (`fromSdlTextEditing`, `toFormattedText`) for the text that is still being composed. The port ledger already lists them as missing in #3518: - `KeyboardHandler.submitPreeditEvent`: "no IME preedit event reaches any screen" - `KeyboardHandler.textEditing`: "no IME composition" - `PreeditEvent.fromSdlTextEditing`: "no IME events are handled" - `PreeditEvent.toFormattedText` I have not read these against the pinned bytecode with `tools/rea_vanilla.py`; whoever fixes this should. ## Suggested direction (not a patch) 1. Allow IME only while a text field has focus, and turn it off otherwise. I expect this keeps movement keys unaffected by the player's input mode; I have not tested that. 2. Handle `WindowEvent::Ime`: `Commit(text)` goes down the same path as `KeyEvent::text` today; `Preedit(text, cursor)` is drawn at the caret, as vanilla's `PreeditEvent` is. Without the preedit, text appears only when the IME commits it, one syllable behind the keys in Korean. 3. Report the caret rectangle with `set_ime_cursor_area` so the candidate window opens at the text box. One shared text-input entry point would avoid changing the 16 call sites one by one. A native mod can't fix this stably: no hook point covers window events or IME, so the fix belongs in the client. ## Environment - Horizon: nightly-2026-10-30-ba6344a (launcher 0.2.0) - OS: Windows 11 Pro 10.0.26200 - Input method: Microsoft IME (Korean) ## Related - #3518 (port gaps: Screens, HUD and client packets) lists the four vanilla methods above. - No open or closed issue found for "IME", "input method", "Korean", "composition", "pinyin" or "Japanese input". Suggested label: `bug`.
bsakaguchi 2026-11-02 15:45:41 +07:00
Author
Owner

@DUzzL commented on GitHub (Oct 30, 2026):

🤖 Agent: /claim

<!-- gh-comment-id:6521101290 --> @DUzzL commented on GitHub (Oct 30, 2026): 🤖 Agent: /claim
Author
Owner

@github-actions[bot] commented on GitHub (Oct 30, 2026):

🤖 Claims: refused, You hold 5 open issues: finish or /unclaim one first. (asked by @DUzzL)

<!-- gh-comment-id:6521104101 --> @github-actions[bot] commented on GitHub (Oct 30, 2026): 🤖 Claims: refused, You hold 5 open issues: finish or `/unclaim` one first. (asked by @DUzzL)
Author
Owner

@kira-horizon[bot] commented on GitHub (Oct 31, 2026):

Also reported on Discord by pmman: Discord thread

What I did:

  1. Launch Horizon.
  2. Enter the game and focus a text input field.
  3. Try to switch from the current keyboard layout to a Chinese input method while typing.

What happened:
I cannot switch to the Chinese input method while typing in the game, so I am unable to enter Chinese characters.

What I expected:
I expected to be able to switch to a Chinese input method and type Chinese characters normally.

Does it happen every time?
Yes.

Horizon version:
Nightly-2026-10-30-1da354b

OS, CPU, GPU:
Windows 11, AMD 9700X, RTX3080

Chinese input method:
Microsoft Pinyin

<!-- gh-comment-id:6538362516 --> @kira-horizon[bot] commented on GitHub (Oct 31, 2026): Also reported on Discord by **pmman**: [Discord thread](https://discord.com/channels/1559227979002028052/1565929107517087754) > What I did: > 1. Launch Horizon. > 2. Enter the game and focus a text input field. > 3. Try to switch from the current keyboard layout to a Chinese input method while typing. > > What happened: > I cannot switch to the Chinese input method while typing in the game, so I am unable to enter Chinese characters. > > What I expected: > I expected to be able to switch to a Chinese input method and type Chinese characters normally. > > Does it happen every time? > Yes. > > Horizon version: > Nightly-2026-10-30-1da354b > > OS, CPU, GPU: > Windows 11, AMD 9700X, RTX3080 > > Chinese input method: > Microsoft Pinyin <!-- kira -->
Author
Owner

@kira-horizon[bot] commented on GitHub (Nov 1, 2026):

Claimed by JustKrabby on Discord (GitHub: JustKarkat), to avoid duplicate work. The claim lapses after 14 days without activity (a comment, a pull request or a commit mentioning #4338).

<!-- gh-comment-id:6559648821 --> @kira-horizon[bot] commented on GitHub (Nov 1, 2026): Claimed by `JustKrabby` on Discord (GitHub: `JustKarkat`), to avoid duplicate work. The claim lapses after 14 days without activity (a comment, a pull request or a commit mentioning #4338). <!-- kira:work -->
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
horizon-rust/horizon#1284
No description provided.