nuxt / ui

A UI Library for Modern Web Apps, powered by Vue & Tailwind CSS.
https://ui.nuxt.com
MIT License
3.9k stars 485 forks source link

Add support for non-Latin keyboard layouts in defineShortcuts composable #2293

Open al1maher opened 3 days ago

al1maher commented 3 days ago

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

Tragio commented 2 days ago

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 🤔