rust-windowing / rust-windowing/winit

macOS: the key-press events of arrow keys are incorrectly suppressed during dead key composition

Open
#4,537 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

B - bug DS - appkit
Dominant language
Rust
Stars
6.2k
Forks
1.3k
Avg merge
2d 19h
Merged PRs (30d)
9

Description

Description

While composing with dead keys, users should be able to move the cursor with arrow keys even if the composition has not yet been finalized, similar to how it works for typical Korean IMEs.

Working case: (builtin 2-Set Korean IME) in an Electron app:
Image
(First-party Apps don't display the underline indicating composition for Korean unless the Hanja candidate window is open. A third-party app is used here for clarity.)

Working case: dead key composition (English U.S. (QWERTY)) in an Electron app:
Image


For Korean IMEs, downstream programs can also implement this correctly, because key-press events of arrow keys are emitted by winit in such case:

Image

KeyboardInput[Pressed ] logical=Named(F2) physical=Code(F2)
window.set_ime_allowed(true)
KeyboardInput[Released] logical=Named(F2) physical=Code(F2)
2026-03-20 15:54:12.805 winit-ime-repro[10004:285524236] error messaging the mach port for IMKCFRunLoopWakeUpReliable
KeyboardInput[Pressed ] logical=Character("ㅁ") physical=Code(KeyA)
KeyboardInput[Released] logical=Character("ㅁ") physical=Code(KeyA)
KeyboardInput[Pressed ] logical=Named(Backspace) physical=Code(Backspace)
KeyboardInput[Released] logical=Named(Backspace) physical=Code(Backspace)
# The logs above are irrelevant. “ㅁ” and Backspace are for working around #3095.

IME Enabled
IME Preedit("ㅎ", Some((3, 3)))
IME Preedit("ㅎ", Some((3, 3)))
IME Preedit("", None)
IME Commit("ㅎ")
IME Preedit("", None)
KeyboardInput[Pressed ] logical=Named(ArrowLeft) physical=Code(ArrowLeft)
KeyboardInput[Released] logical=Named(ArrowLeft) physical=Code(ArrowLeft)

In contrast, during dead key composition, downstream programs are out of luck, because winit suppresses key-press events of those arrow keys:

Image

KeyboardInput[Pressed ] logical=Named(F2) physical=Code(F2)
window.set_ime_allowed(true)
KeyboardInput[Released] logical=Named(F2) physical=Code(F2)
# The logs above are irrelevant.

KeyboardInput[Pressed ] logical=Named(Alt) physical=Code(AltLeft)
IME Enabled
IME Preedit("˜", Some((2, 2)))
KeyboardInput[Released] logical=Named(Alt) physical=Code(AltLeft)
IME Preedit("", None)
IME Commit("˜")
KeyboardInput[Released] logical=Named(ArrowLeft) physical=Code(ArrowLeft)

The key-release event of the left arrow is there due to another bug (#4526).

Reproduction

https://gist.github.com/umajho/5f42a9cfe49ecfe61d4a9753796d00f2

macOS version
ProductName:		macOS
ProductVersion:		15.7.3
BuildVersion:		24G419
Winit version

0.30.13

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 with the linked reproduction gist and compare its dead-key and Korean IME event logs on macOS 15.7.3 with winit 0.30.13; review issue #4526 for the related release-event behavior. Done means arrow-key press and release events remain available during dead-key composition without regressing IME handling.

Written by the indexing model from the issue text.

Assessment

Tech stack
macos, rust
Domain
desktop, internationalization
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.