Upstream: JetBrains/jcef#46
Symptom
On macOS, 8 of the 13 Alt(⌥) shortcuts do not perform their own action — they silently perform a different action. Nothing appears broken; the wrong thing just happens.
The most visible case: focus a table and press ⌥N to add a table. Instead of a new table, every column of the focused table gets selected.
This only happens with a Latin input source (ABC / U.S.). With the Korean 2-Set input source everything works, which makes it look like an IME problem. It is not.
Affected shortcuts
The upstream bug collapses the code of every ⌥+character keystroke to KeyA, so each broken binding lands on whatever is bound to Alt+KeyA / $mod+Alt+KeyA.
| Shortcut |
Intended action |
What actually runs |
⌥N |
addTable |
❌ selectAllColumn |
⌥M |
addMemo |
❌ selectAllColumn |
⌥K |
primaryKey |
❌ selectAllColumn |
⌥Space |
tableProperties |
❌ selectAllColumn |
⌘⌥1 |
relationshipZeroOne |
❌ selectAllTable |
⌘⌥2 |
relationshipZeroN |
❌ selectAllTable |
⌘⌥3 |
relationshipOneOnly |
❌ selectAllTable |
⌘⌥4 |
relationshipOneN |
❌ selectAllTable |
⌥A |
selectAllColumn |
✅ correct — but only by coincidence, since the corrupted value is KeyA |
⌘⌥A |
selectAllTable |
✅ same coincidence |
⌥Enter |
addColumn |
✅ routed through a getKeyCode() special case upstream |
⌥Backspace |
removeColumn |
✅ same |
⌥Delete |
removeColumn |
✅ same |
Bindings are from erd-editor/packages/erd-editor/src/utils/keyboard-shortcut/index.ts.
Cause
Not our code, and not the IntelliJ Platform. It is in the JCEF native glue bundled with JetBrains Runtime — native/keyboard_utils.cpp derives the macOS native_key_code from the character rather than the physical key, then coerces the "unknown" sentinel -1 to 0, which is a real virtual key code (kVK_ANSI_A).
On a Latin layout ⌥ rewrites the character to something non-ASCII (⌥M→µ, ⌥K→˚, ⌥1→¡), which falls outside the lookup table's U+000A–U+007E domain — hence -1, hence KeyA. The Korean 2-Set layout's Option layer emits plain roman letters, so it passes through correctly. Full analysis, disassembly and UCKeyTranslate measurements are in the upstream issue.
Two consequences for us:
- No webview-side fix is possible. The corruption happens inside the IDE JVM, so Chromium only ever sees a synthetic
NSEvent with keyCode: 0. event.key, event.code, event.keyCode and event.which are all consistently wrong by the time JS runs.
- No Registry workaround. Both in-process and out-of-process JCEF call the same native function.
Options
- Rebind away from
Alt+character/digit via editor.setKeyBindingMap in packages/intellij-webview. Cheapest and fixes it for every affected IDE version, but diverges from the web/VS Code builds' shortcuts.
- Register IntelliJ
AnActions and dispatch over the bridge. More work, but the shortcuts become IDE-native and user-remappable in Keymap settings — and it sidesteps the ⌥Space conflict with IntelliJ's QuickImplementations as a bonus.
- Wait for the upstream fix. Even if it lands, it ships in a new JBR, so users on our
pluginSinceBuild = 252 floor stay broken for a long time. Not viable on its own.
Reproduce
- macOS, input source set to ABC or U.S.
- Open any
.erd / .erd.json file
- Focus a table, press
⌥N
Expected: a new table. Actual: all columns of the focused table get selected.
Background notes on this bug already live in AGENTS.md under the JCEF Gotchas section.
Upstream: JetBrains/jcef#46
Symptom
On macOS, 8 of the 13
Alt(⌥)shortcuts do not perform their own action — they silently perform a different action. Nothing appears broken; the wrong thing just happens.The most visible case: focus a table and press
⌥Nto add a table. Instead of a new table, every column of the focused table gets selected.This only happens with a Latin input source (ABC / U.S.). With the Korean 2-Set input source everything works, which makes it look like an IME problem. It is not.
Affected shortcuts
The upstream bug collapses the
codeof every⌥+character keystroke toKeyA, so each broken binding lands on whatever is bound toAlt+KeyA/$mod+Alt+KeyA.⌥NaddTableselectAllColumn⌥MaddMemoselectAllColumn⌥KprimaryKeyselectAllColumn⌥SpacetablePropertiesselectAllColumn⌘⌥1relationshipZeroOneselectAllTable⌘⌥2relationshipZeroNselectAllTable⌘⌥3relationshipOneOnlyselectAllTable⌘⌥4relationshipOneNselectAllTable⌥AselectAllColumnKeyA⌘⌥AselectAllTable⌥EnteraddColumngetKeyCode()special case upstream⌥BackspaceremoveColumn⌥DeleteremoveColumnBindings are from
erd-editor/packages/erd-editor/src/utils/keyboard-shortcut/index.ts.Cause
Not our code, and not the IntelliJ Platform. It is in the JCEF native glue bundled with JetBrains Runtime —
native/keyboard_utils.cppderives the macOSnative_key_codefrom the character rather than the physical key, then coerces the "unknown" sentinel-1to0, which is a real virtual key code (kVK_ANSI_A).On a Latin layout
⌥rewrites the character to something non-ASCII (⌥M→µ,⌥K→˚,⌥1→¡), which falls outside the lookup table'sU+000A–U+007Edomain — hence-1, henceKeyA. The Korean 2-Set layout's Option layer emits plain roman letters, so it passes through correctly. Full analysis, disassembly andUCKeyTranslatemeasurements are in the upstream issue.Two consequences for us:
NSEventwithkeyCode: 0.event.key,event.code,event.keyCodeandevent.whichare all consistently wrong by the time JS runs.Options
Alt+character/digit viaeditor.setKeyBindingMapinpackages/intellij-webview. Cheapest and fixes it for every affected IDE version, but diverges from the web/VS Code builds' shortcuts.AnActions and dispatch over the bridge. More work, but the shortcuts become IDE-native and user-remappable in Keymap settings — and it sidesteps the⌥Spaceconflict with IntelliJ'sQuickImplementationsas a bonus.pluginSinceBuild = 252floor stay broken for a long time. Not viable on its own.Reproduce
.erd/.erd.jsonfile⌥NExpected: a new table. Actual: all columns of the focused table get selected.
Background notes on this bug already live in
AGENTS.mdunder the JCEF Gotchas section.