github / github/hotkey

Add support for global hotkeys

Open
#144 2 comments 1 reaction 0 assignees View on GitHub
Dominant language
JavaScript
Stars
3.3k
Forks
99
Avg merge
14h 22m
Merged PRs (30d)
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

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.