Open
Description
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
Activity
Tragio commentedon Oct 3, 2024
Hi @al1maher 👋 ,
Could you give us a little reproduction so we can have a base to work on? Perhaps this is already fixed on v3, or we can work on it for v3 🤔
dvrtnkv commentedon Jan 10, 2025
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.
Thank you for considering this!
feat: add layoutIndependent option for keyboard shortcuts
layoutIndependent
option for keyboard shortcuts #4251code
insteadkey
in defineShortcuts #3817 as a duplicate of this issue