1 | // @flow
|
2 | import { parseHotkey } from 'is-hotkey';
|
3 |
|
4 | // Returns a fake Event object for the given hotkey
|
5 | export default function simulateKey(hotkey: string): Event {
|
6 | return {
|
7 | preventDefault() {},
|
8 | stopPropagation() {},
|
9 | ...parseHotkey(hotkey, { byKey: true })
|
10 | };
|
11 | }
|