parent
b1aef1743f
commit
fd11c4f323
@ -0,0 +1,14 @@
|
|||||||
|
import { inject } from 'vue'
|
||||||
|
const mousetrap = inject('mousetrap') as any
|
||||||
|
const commonKeyDown = (keyCode: number) => {
|
||||||
|
document.dispatchEvent(new KeyboardEvent('keydown', { keyCode }));
|
||||||
|
}
|
||||||
|
const c = () => {
|
||||||
|
commonKeyDown(27)
|
||||||
|
}
|
||||||
|
|
||||||
|
const initBind = () => {
|
||||||
|
mousetrap.bind('c', c)
|
||||||
|
}
|
||||||
|
|
||||||
|
export default initBind;
|
Loading…
Reference in new issue