diff --git a/src/js/app.js b/src/js/app.js index 8ad01a3..5b0fa32 100644 --- a/src/js/app.js +++ b/src/js/app.js @@ -217,7 +217,6 @@ Anot({ * 响应 全局快捷键的事件 */ WIN.on('gs-ctrl', ev => { - log('gs-ctrl: ', ev) switch (ev) { case 'prev': this.nextSong(-1) @@ -236,6 +235,26 @@ Anot({ SONIST.pause() this.draw() break + case 'vu': + this.volume += 5 + if (this.volume >= 100) { + this.volume = 100 + } + SONIST.volume = this.volume + break + case 'vd': + this.volume -= 5 + if (this.volume <= 0) { + this.volume = 0 + } + SONIST.volume = this.volume + break + case 'lrc': + this.toggleDesktopLrc() + break + case 'mini': + this.change2mini() + break default: break } @@ -280,7 +299,6 @@ Anot({ this.volume = 0 } SONIST.volume = this.volume - break } break case 77: // M (迷你模式) diff --git a/src/tools/shortcut.js b/src/tools/shortcut.js index 06bc4a4..6d549c3 100644 --- a/src/tools/shortcut.js +++ b/src/tools/shortcut.js @@ -23,5 +23,35 @@ module.exports = { GS.register('MediaPlayPause', _ => { win.emit('gs-ctrl', 'play') }) + + // others + + GS.register('Super+Alt+Space', _ => { + win.emit('gs-ctrl', 'play') + }) + + GS.register('Super+Alt+Left', _ => { + win.emit('gs-ctrl', 'prev') + }) + + GS.register('Super+Alt+Right', _ => { + win.emit('gs-ctrl', 'next') + }) + + GS.register('Super+Alt+Up', _ => { + win.emit('gs-ctrl', 'vu') + }) + + GS.register('Super+Alt+Down', _ => { + win.emit('gs-ctrl', 'vd') + }) + + GS.register('Super+Alt+R', _ => { + win.emit('gs-ctrl', 'lrc') + }) + + GS.register('Super+Alt+Shift+M', _ => { + win.emit('gs-ctrl', 'mini') + }) } } diff --git a/src/tools/windows.js b/src/tools/windows.js index bac8561..951560a 100644 --- a/src/tools/windows.js +++ b/src/tools/windows.js @@ -33,7 +33,7 @@ exports.createMainWindow = function(icon) { win.on('ready-to-show', _ => { win.show() - win.openDevTools() + // win.openDevTools() }) return win