better spacebar control, disable it completely in dev mode
This commit is contained in:
parent
47e25ae2f2
commit
6ea19e49f7
2 changed files with 12 additions and 2 deletions
|
@ -100,8 +100,8 @@ export default class Thumbar {
|
|||
submenu: [
|
||||
{
|
||||
label: 'Pause / Play',
|
||||
accelerator: 'CommandOrControl+Space',
|
||||
click: () => this._win.webContents.executeJavaScript(`MusicKitInterop.playPause()`)
|
||||
accelerator: 'Space',
|
||||
click: () => this._win.webContents.executeJavaScript(`app.SpacePause()`)
|
||||
},
|
||||
{
|
||||
label: 'Next',
|
||||
|
|
|
@ -3572,6 +3572,16 @@ const app = new Vue({
|
|||
darwinShare(url) {
|
||||
ipcRenderer.send('share-menu', url)
|
||||
},
|
||||
SpacePause() {
|
||||
const elems = document.querySelectorAll('input');
|
||||
for (elem of elems){
|
||||
if (elem === document.activeElement) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (!this.isDev) // disable in dev mode to keep my sanity
|
||||
MusicKitInterop.playPause();
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue