Duplicate keydown events with keyCode 229 and 13 when pressing Enter during Japanese IME composition
OS: Windows 11 · Device: Desktop or Laptop Any · Browser: Chrome 120.0
Open case →Scenario
During IME composition, keydown often reports keyCode 229 (VK_PROCESSKEY on Windows) for many keys, meaning the event is part of an input method sequence. Enter may commit composition, insert a newline, or be swallowed—Chrome vs Firefox vs Japanese layouts differ. Handlers that assume Enter always means insertParagraph break composition incorrectly.
During IME composition, keydown often reports keyCode 229 (VK_PROCESSKEY on Windows) for many keys, meaning the event is part of an input method sequence. Enter may commit composition, insert a newline, or be swallowed—Chrome vs Firefox vs Japanese layouts differ. Handlers that assume Enter always means insertParagraph break composition incorrectly.
Legacy keyCode / which APIs are deprecated but still used in hot paths. 229 is a sentinel: “handled by IME; don’t treat as a normal key.” Ignoring that and running custom Enter logic during isComposing causes double commits or cancelled composition.
beforeinput may carry insertLineBreak or composition commit depending on engine.Duplicate lines, lost syllables, or editors that block Enter entirely during IME.
Chrome and Firefox dispatch different sequences around Enter + composition; macOS vs Windows keyboard stacks add variance.
e.isComposing and beforeinput inputType over raw keyCode for control flow.keydown, treat 229 as “possibly IME—do not insert structural nodes.”Visual view of how this scenario connects to its concrete cases and environments. Nodes can be dragged and clicked.
Each row is a concrete case for this scenario, with a dedicated document and playground.
| Case | OS | Device | Browser | Keyboard | Status |
|---|---|---|---|---|---|
| ce-0210-ime-keydown-keycode-229-enter-chrome | Windows 11 | Desktop or Laptop Any | Chrome 120.0 | Korean (IME) | draft |
| ce-0211-ime-keydown-keycode-229-enter-firefox | Windows 11 | Desktop or Laptop Any | Firefox 120.0 | Korean (IME) | draft |
| ce-0212-ime-keydown-keycode-229-enter-japanese-chrome | Windows 11 | Desktop or Laptop Any | Chrome 120.0 | Japanese (IME) | draft |
This matrix shows which browser and OS combinations have documented cases for this scenario. Click on a cell to view the specific case.
| Browser | Windows |
|---|---|
| Chrome | |
| Firefox |
This scenario affects multiple languages. Cases are grouped by language/input method below.
OS: Windows 11 · Device: Desktop or Laptop Any · Browser: Chrome 120.0
Open case →OS: Windows 11 · Device: Desktop or Laptop Any · Browser: Chrome 120.0
Open case →OS: Windows 11 · Device: Desktop or Laptop Any · Browser: Firefox 120.0
Open case →Other scenarios that share similar tags or category.
If the user switches focus to another field, button, or nested contenteditable while Korean (or other) IME composition is active, browsers differ on whether composition is committed, cancelled, or leaves orphan state. Chrome, Safari, and Firefox do not agree; mobile adds more variance.
Pasting from the clipboard while IME composition is active may cancel the composition session, replace the wrong range, or interleave pasted text with unfinished syllables—Firefox and Chrome show different behavior for Korean and Hindi IME paths.
Escape typically cancels IME composition or closes the candidate window. In Edge, Firefox, and other engines, timing and whether partial text remains in the DOM differ—Arabic and Korean IME cases show cross-browser variance.
Moving focus away from the editor while composing text (Chinese, Japanese, Korean) can cancel composition, commit partial text, or leave the IME candidate window out of sync. Safari often shows distinct behavior for Japanese; Chrome behavior for Chinese/Korean is covered in related cases.
Tab moves focus by default. During IME composition, Tab may cancel composition, cycle candidates, or be captured by the editor for indentation—behavior differs for Chinese, Thai, and Safari vs Firefox.
Have questions, suggestions, or want to share your experience? Join the discussion below.