Skip to content
This repository has been archived by the owner on Feb 26, 2021. It is now read-only.

Commit

Permalink
Fix #238, avoid showing keyboard shortcut in popup
Browse files Browse the repository at this point in the history
The Command key itself (and maybe the Ctrl key?) show up as events, even though they don't lead to any text input, and should be ignored.
  • Loading branch information
ianb committed Sep 18, 2019
1 parent 02f0ca7 commit d1bd5a8
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions extension/popup/ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,12 @@ this.ui = (function() {
};

function detectText(e) {
if (e.keyCode === 224 || e.keyCode === 17) {
// 224 is the key code for the Mac Command key
// 17 is the key code for Ctrl (not verified)
console.log("skipping text input");
return;
}
if (!textInputDetected) {
exports.setState("typing");
textInputDetected = true;
Expand Down

0 comments on commit d1bd5a8

Please sign in to comment.