aboutsummaryrefslogtreecommitdiff
path: root/src/content/InputDriver.ts
diff options
context:
space:
mode:
authorShin'ya Ueoka <ueokande@i-beam.org>2019-05-18 21:43:56 +0900
committerShin'ya Ueoka <ueokande@i-beam.org>2019-05-18 21:43:56 +0900
commita5518dce3d101cb1cb65724b82079f66f20c80c8 (patch)
tree79537b86e4a7bf231e8801c9c6bf2aeb94450343 /src/content/InputDriver.ts
parent2ec912c262b51fe9523ebf74d5062d0b9bbdab71 (diff)
Define Key and KeySequence
Diffstat (limited to 'src/content/InputDriver.ts')
-rw-r--r--src/content/InputDriver.ts6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/content/InputDriver.ts b/src/content/InputDriver.ts
index 09648c1..cddc825 100644
--- a/src/content/InputDriver.ts
+++ b/src/content/InputDriver.ts
@@ -1,5 +1,5 @@
import * as dom from '../shared/utils/dom';
-import * as keys from '../shared/utils/keys';
+import Key, * as keys from './domains/Key';
const cancelKey = (e: KeyboardEvent): boolean => {
return e.key === 'Escape' || e.key === '[' && e.ctrlKey;
@@ -8,7 +8,7 @@ const cancelKey = (e: KeyboardEvent): boolean => {
export default class InputDriver {
private pressed: {[key: string]: string} = {};
- private onKeyListeners: ((key: keys.Key) => boolean)[] = [];
+ private onKeyListeners: ((key: Key) => boolean)[] = [];
constructor(target: HTMLElement) {
this.pressed = {};
@@ -19,7 +19,7 @@ export default class InputDriver {
target.addEventListener('keyup', this.onKeyUp.bind(this));
}
- onKey(cb: (key: keys.Key) => boolean) {
+ onKey(cb: (key: Key) => boolean) {
this.onKeyListeners.push(cb);
}