Register "media key" for play/pause
This commit is contained in:
@@ -2,11 +2,16 @@ module.exports = {
|
||||
init: init
|
||||
}
|
||||
|
||||
var electron = require('electron')
|
||||
var globalShortcut = electron.globalShortcut
|
||||
var localShortcut = require('electron-localshortcut')
|
||||
|
||||
function init (menu) {
|
||||
function init (menu, windows) {
|
||||
// ⌘+Shift+F is an alternative fullscreen shortcut to the ones defined in menu.js.
|
||||
// Electron does not support multiple accelerators for a single menu item, so this
|
||||
// is registered separately here.
|
||||
localShortcut.register('CmdOrCtrl+Shift+F', menu.toggleFullScreen)
|
||||
|
||||
// Special "media key" for play/pause, available on some keyboards
|
||||
globalShortcut.register('MediaPlayPause', () => windows.main.send('dispatch', 'playPause'))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user