Add support for global hotkeys
- 主要言語
- JavaScript
- スター
- 3.3k
- フォーク
- 99
- 平均マージ
- 14時間 22分
- マージ済み PR(30日)
- 6
説明
**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
コントリビューションガイド
調査の方向性
まず、ホットキー処理のエントリーポイントと、issue にリンクされている関連する Mousetrap Global Bind の実装を読みます。inputs と textareas でショートカットがどのように抑制されるかを確認し、次に、オプトイン属性 data-hotkey-global によって、デフォルトの動作を変更せずに、要求されたショートカットをそこでトリガーできることを検証します。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- javascript
- 領域
- frontend
- issue の種類
- 機能追加
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 45/100