(win)
| 41 | ) |
| 42 | |
| 43 | const registerKeyboradShortcut = (win) => { |
| 44 | const prefix = process.platform === 'darwin' ? 'Command' : 'Ctrl' |
| 45 | // If another window focused, register a new shortcut |
| 46 | if ( |
| 47 | globalShortcut.isRegistered(`${prefix}+R`) |
| 48 | || globalShortcut.isRegistered(`${prefix}+I`) |
| 49 | ) { |
| 50 | globalShortcut.unregisterAll() |
| 51 | } |
| 52 | globalShortcut.register(`${prefix}+R`, () => invokeDevMethod(win, 'reload')) |
| 53 | globalShortcut.register(`${prefix}+I`, () => invokeDevMethod(win, 'toggleElementInspector')) |
| 54 | } |
| 55 | |
| 56 | const unregisterKeyboradShortcut = () => globalShortcut.unregisterAll() |
| 57 |
no test coverage detected