github / github/hotkey

Add support for global hotkeys

オープン
#144 コメント 2 件 リアクション 1 件 担当者 0 名 GitHub で見る
主要言語
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

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。