diff options
author | Shin'ya Ueoka <ueokande@i-beam.org> | 2019-09-05 12:48:10 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-09-05 12:48:10 +0000 |
commit | 0fc2eea7431649f85c6e5d57cca66457f24bb14d (patch) | |
tree | ff7139f8047a23011c329f1c93eb79fac234cce3 /src/content/InputDriver.ts | |
parent | 428805e66f993884643136dc2d8267c53bd81588 (diff) | |
parent | bf9bec21461991a1e4b7581446ecfe21091a9597 (diff) |
Merge pull request #641 from ueokande/cancel-by-ctrl-c
Cancel console by Ctrl+C
Diffstat (limited to 'src/content/InputDriver.ts')
-rw-r--r-- | src/content/InputDriver.ts | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/content/InputDriver.ts b/src/content/InputDriver.ts index cddc825..0472088 100644 --- a/src/content/InputDriver.ts +++ b/src/content/InputDriver.ts @@ -2,7 +2,13 @@ import * as dom from '../shared/utils/dom'; import Key, * as keys from './domains/Key'; const cancelKey = (e: KeyboardEvent): boolean => { - return e.key === 'Escape' || e.key === '[' && e.ctrlKey; + if (e.key === 'Escape') { + return true; + } + if (e.key === '[' && e.ctrlKey) { + return true; + } + return false; }; export default class InputDriver { |