1
0
mirror of https://github.com/h3poteto/whalebird-desktop synced 2025-01-30 17:15:16 +01:00

refs #366 Add shortcut key to jump

This commit is contained in:
AkiraFukushima 2018-06-05 21:24:53 +09:00
parent 1543e01f52
commit aab9508bb5
2 changed files with 9 additions and 1 deletions

View File

@ -1,6 +1,6 @@
'use strict'
import { app, ipcMain, BrowserWindow, shell, Menu } from 'electron'
import { app, ipcMain, BrowserWindow, shell, Menu, globalShortcut } from 'electron'
import Datastore from 'nedb'
import empty from 'is-empty'
import log from 'electron-log'
@ -238,6 +238,10 @@ function createWindow () {
mainWindow.on('closed', () => {
mainWindow = null
})
globalShortcut.register('CommandOrControl+T', () => {
mainWindow.webContents.send('CmdOrCtrl+T')
})
})
}

View File

@ -128,10 +128,14 @@ const TimelineSpace = {
ipcRenderer.on('CmdOrCtrl+K', () => {
commit('TimelineSpace/Modals/Jump/changeModal', true, { root: true })
})
ipcRenderer.on('CmdOrCtrl+T', () => {
commit('TimelineSpace/Modals/Jump/changeModal', true, { root: true })
})
},
async removeShortcutEvents () {
ipcRenderer.removeAllListeners('CmdOrCtrl+N')
ipcRenderer.removeAllListeners('CmdOrCtrl+K')
ipcRenderer.removeAllListeners('CmdOrCtrl+T')
return 'removeShortcutEvents'
},
async clearAccount ({ commit }) {