Skip to content

[Bug Report][3.11.4] useHotkey does not trigger for Latin letters in non-Latin keyboard layouts (e.g. Cyrillic)Β #22457

@Vemq

Description

@Vemq

Environment

Vuetify Version: 3.11.4
Vue Version: 3.5.25
OS: Ubuntu undefined (current)

Expected Behavior

Hotkeys should work consistently across keyboard layouts.

Solutions:

  1. Always use KeyboardEvent.code instead KeyboardEvent.key for letter keys.

  2. Allow to choose the matching strategy by using code as keys:
    useHotkey('KeyB', callback) β†’ matches by code, with 'B, or 'И' or any key with code 'KeyB', works in any layout
    useHotkey('B', callback) β†’ matches by key, only when the typed character is 'B', not 'И') - current behavior

  3. Add keyCode option in HotkeyOptions:
    useHotkey('B', callback, { keyCode: true })

Actual Behavior

Latin letter hotkeys ignored in non-Latin layouts. For example Ctrl + B in playground link from documentation ignored in Cyrillic layout .

Reproduction Link

https://play.vuetifyjs.com/#...

Metadata

Metadata

Assignees

No one assigned

    Labels

    E: hotkeyT: enhancementFunctionality that enhances existing featuresi18nInternationalization issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions