- TypeScript 100%
| client | ||
| .dprint.json | ||
| .gitignore | ||
| index.client.tsx | ||
| package.json | ||
| paseo-plugin.json | ||
| README.md | ||
| tsconfig.json | ||
Paseo Localized Shortcuts
A Paseo plugin that makes the built-in keyboard shortcuts work in the browser while a non-Latin keyboard layout (Cyrillic, Greek, Hebrew, Arabic, ...) is active.
The problem
Paseo resolves a shortcut by the character a key produces (KeyboardEvent.key)
and only falls back to the physical key (KeyboardEvent.code) for Alt bindings
and Space/Enter. On a non-Latin layout the produced character is never the Latin
letter a binding was authored with, so Ctrl+S, Cmd+K, Ctrl+P, and every
other letter or punctuation shortcut silently stops working.
What the plugin does
It listens for keydown in the browser and, when a shortcut modifier is held and the produced character belongs to a non-Latin script, re-dispatches the event with the Latin key for the same physical key. Paseo's own shortcut engine then matches and routes it as usual. No action is reimplemented.
Scope is intentionally narrow:
- Only while Ctrl, Cmd, or Alt is held, so plain typing and the terminal are never touched.
- Only for non-Latin scripts, so Dvorak, AZERTY, and accented Latin layouts keep their logical-character matching.
- The synthetic event is dispatched on
window, so element-level handlers (xterm, editors, React inputs) do not see it. Focus scope still resolves fromdocument.activeElement. - Shortcut recording and overlays stop propagation before this listener runs, so rebinding is unaffected.
Not covered: shortcuts that use only Shift (for example Shift+?), and the
embedded browser pane in the Electron desktop app (its keys are filtered in the
main process before they reach the app).
Install
The plugin is installed from Git:
paseo plugin install git:https://git.kosyrev.name/zoo/paseo-localized-shortcuts.git
paseo plugin ls
Update later:
paseo plugin update paseo-localized-shortcuts
Plugins are trusted, unsandboxed code. Read the source before installing.
Usage
The fix is active as soon as the plugin loads. A Localized Shortcuts item appears in the sidebar with an on/off switch and a short explanation.
Development
npm install
npm run typecheck
npm run format
paseo plugin reload paseo-localized-shortcuts
paseo plugin logs paseo-localized-shortcuts
Paseo compiles the TypeScript itself. The development dependencies exist only
for local typechecking. Formatting uses dprint with the
config in .dprint.json; dprint must be on PATH.