Skip to content

feat(keyboard-shortcuts): add alternativeShortcutKeys config for layout-independent shortcuts#17176

Open
iospro wants to merge 1 commit intojitsi:masterfrom
iospro:feat/alternative-shortcuts
Open

feat(keyboard-shortcuts): add alternativeShortcutKeys config for layout-independent shortcuts#17176
iospro wants to merge 1 commit intojitsi:masterfrom
iospro:feat/alternative-shortcuts

Conversation

@iospro
Copy link
Contributor

@iospro iospro commented Mar 21, 2026

Problem

On non-QWERTY keyboard layouts (e.g. AZERTY, QWERTZ, Cyrillic) the physical keys produce different characters, so existing single-key shortcuts (like A, V, C) stop working correctly — the keypress event delivers the layout-specific character rather than the intended one.

Solution

Add an alternativeShortcutKeys config option that maps alternative key codes to their primary shortcut equivalents. When a keydown event doesn't match any registered shortcut directly, the handler looks up whether the pressed key has a primary mapping and dispatches that shortcut instead.

Changes

  • config.js — documents new alternativeShortcutKeys option: Array<{ key: string; alt: string }>
  • configType.ts — adds TypeScript type for alternativeShortcutKeys
  • configWhitelist.ts — allows alternativeShortcutKeys to be overridden via configOverwrite
  • keyboard-shortcuts/functions.ts — adds getPrimaryShortcutKey(state, altKey) selector
  • keyboard-shortcuts/actions.ts — extends keyDownHandler to resolve alternative keys before shortcut lookup

Usage

// config.js or configOverwrite
alternativeShortcutKeys: [
    { key: 'A', alt: 'Q' },  // AZERTY: Q physical key → A shortcut
    { key: 'M', alt: 'µ' },  // macOS option key variant
]

@jitsi-jenkins
Copy link

Hi, thanks for your contribution!
If you haven't already done so, could you please make sure you sign our CLA (https://jitsi.org/icla for individuals and https://jitsi.org/ccla for corporations)? We would unfortunately be unable to merge your patch unless we have that piece :(.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants