wip
This commit is contained in:
parent
218db0771f
commit
f5a8383d2a
@ -43,6 +43,12 @@
|
|||||||
"default": "Alt+Insert"
|
"default": "Alt+Insert"
|
||||||
},
|
},
|
||||||
"description": "Open search window"
|
"description": "Open search window"
|
||||||
|
},
|
||||||
|
"options": {
|
||||||
|
"suggested_key": {
|
||||||
|
"default": "Alt+End"
|
||||||
|
},
|
||||||
|
"description": "Open options page"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"web_accessible_resources": ["fg/frame.html"],
|
"web_accessible_resources": ["fg/frame.html"],
|
||||||
|
@ -211,11 +211,8 @@ class Display {
|
|||||||
}
|
}
|
||||||
|
|
||||||
onKeyDown(e) {
|
onKeyDown(e) {
|
||||||
|
const requireAlt = ['e', 'k', 'p'];
|
||||||
const handlers = {
|
const handlers = {
|
||||||
8: /* backspace */ () => {
|
|
||||||
|
|
||||||
},
|
|
||||||
|
|
||||||
27: /* escape */ () => {
|
27: /* escape */ () => {
|
||||||
this.clearSearch();
|
this.clearSearch();
|
||||||
},
|
},
|
||||||
@ -244,21 +241,21 @@ class Display {
|
|||||||
this.entryScroll(this.index + 1, true);
|
this.entryScroll(this.index + 1, true);
|
||||||
},
|
},
|
||||||
|
|
||||||
209: /* [ */ () => {
|
69: /* e */ () => {
|
||||||
|
this.noteAdd(this.definitions[this.index], 'term-kanji');
|
||||||
},
|
},
|
||||||
|
|
||||||
220: /* \ */ () => {
|
75: /* k */ () => {
|
||||||
|
this.noteAdd(this.definitions[this.index], 'term-kana');
|
||||||
|
},
|
||||||
|
|
||||||
|
80: /* p */ () => {
|
||||||
this.audioPlay(this.definitions[this.index]);
|
this.audioPlay(this.definitions[this.index]);
|
||||||
},
|
|
||||||
|
|
||||||
221: /* ] */ () => {
|
|
||||||
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const handler = handlers[e.keyCode];
|
const handler = handlers[e.keyCode];
|
||||||
if (handler) {
|
if (handler && (e.altKey || !requireAlt.includes(e.keyCode))) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
handler();
|
handler();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user