MCPcopy Create free account
hub / github.com/jhen0409/react-native-debugger / registerKeyboradShortcut

Function registerKeyboradShortcut

electron/window.js:43–54  ·  view source on GitHub ↗
(win)

Source from the content-addressed store, hash-verified

41)
42
43const 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
56const unregisterKeyboradShortcut = () => globalShortcut.unregisterAll()
57

Callers 1

registerShortcutsFunction · 0.85

Calls 1

invokeDevMethodFunction · 0.70

Tested by

no test coverage detected