github / github/hotkey

Add support for global hotkeys

Aperta
#144 2 commenti 1 reazione 0 assegnatari Vedi su GitHub
Lingua principale
JavaScript
Stelle
3.3k
Fork
99
Merge medio
14h 22m
PR unite (30g)
6

Descrizione

**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

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Start by reading the hotkey handling entry point and the related Mousetrap Global Bind implementation linked in the issue. Check how shortcuts are suppressed for inputs and textareas, then verify that an opt-in data-hotkey-global attribute allows the requested shortcuts to trigger there without changing default behavior.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
javascript
Ambito
frontend
Tipo di issue
Funzionalità
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
45/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.