Add support for global hotkeys
- Langage dominant
- JavaScript
- Étoiles
- 3.3k
- Forks
- 99
- Merge moyen
- 14 h 22 min
- PR mergées (30 j)
- 6
Description
**Problem**
Hotkeys do not trigger when the focused element is an input or textfield.
**Suggestion**
Add opt in support for global hotkeys that fire even when focus is inside some input form/textarea. There are cases where certain shortcuts (e.g Ctrl+S to click save button, Ctrl+K to click a command palette) should work everywhere including when the user is typing in some textarea.
The feature is similar to [Mousetrap’s Global Bind](https://github.com/ccampbell/mousetrap/tree/master/plugins/global-bind).
#### Possible Implementation
Introduce a `data-hotkey-global` attribute:
```
Save
```
#### Related Work
https://github.com/github/hotkey/pull/48
Guide de contribution
Ouvrir le guide de contribution
Piste de recherche
Commencez par lire le point d’entrée de la gestion des hotkeys et l’implémentation associée de Mousetrap Global Bind liée dans l’issue. Vérifiez comment les raccourcis sont supprimés pour les inputs et les textareas, puis vérifiez qu’un attribut opt-in data-hotkey-global permet aux raccourcis demandés de se déclencher à cet endroit sans modifier le comportement par défaut.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- javascript
- Domaine
- frontend
- Type d'issue
- Fonctionnalité
- Difficulté
- 3/5
- Temps estimé
- 1-2 jours
- Activité
- À l'abandon
- Clarté
- Plutôt claire
- Accessibilité débutants
- 45/100