You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Problem
The current implementation of the keyboard shortcuts composable (defineShortcuts) doesn't work correctly with non-Latin keyboard layouts, such as Arabic. This limits the usability of the composable for users with different language settings.
Proposed Solution
Implement an optional configuration flag 'layoutIndependent' that, when set to true, makes the composable use KeyboardEvent.code instead of KeyboardEvent.key. This change will allow the shortcuts to work regardless of the keyboard layout or language setting.
Additional context
No response
The text was updated successfully, but these errors were encountered:
I completely agree with the need for this improvement. Currently, I face the same issue where I have to duplicate shortcut definitions for different keyboard layouts. Here's an example from my project:
It would be incredibly helpful if defineShortcuts allowed binding based on event.code, which is independent of the active keyboard layout. This enhancement would significantly simplify handling shortcuts across different languages.
Add optional layoutIndependent flag to defineShortcuts composable that enables
layout-agnostic keyboard shortcuts by using KeyboardEvent.code instead of
KeyboardEvent.key.
When enabled, shortcuts work consistently across different keyboard layouts
(Arabic, Hebrew) by matching physical key positions rather than
character values.
Usage:
- layoutIndependent: false (default) - uses e.key for character-based matching
- layoutIndependent: true - uses e.code for physical key matching
Breaking change: When layoutIndependent is true, shortcut definitions must
use physical key codes (e.g., 'ctrl_KeyS' instead of 'ctrl_s').
Closes: nuxt#2293
Uh oh!
There was an error while loading. Please reload this page.
Description
Problem
The current implementation of the keyboard shortcuts composable (defineShortcuts) doesn't work correctly with non-Latin keyboard layouts, such as Arabic. This limits the usability of the composable for users with different language settings.
Proposed Solution
Implement an optional configuration flag 'layoutIndependent' that, when set to true, makes the composable use KeyboardEvent.code instead of KeyboardEvent.key. This change will allow the shortcuts to work regardless of the keyboard layout or language setting.
Additional context
No response
The text was updated successfully, but these errors were encountered: