ADD: More shortcuts
This commit is contained in:
10
src/App.vue
10
src/App.vue
@@ -8,10 +8,16 @@ import { useStore } from '@/store'
|
|||||||
const { electron } = window
|
const { electron } = window
|
||||||
const store = useStore()
|
const store = useStore()
|
||||||
|
|
||||||
|
const menuActions = {
|
||||||
|
connect: () => store.setConnected(!store.connected),
|
||||||
|
orientation: () => store.cycleScreenOrientation(),
|
||||||
|
skin: () => store.switchPreviewDeviceModel(),
|
||||||
|
}
|
||||||
|
|
||||||
electron.onMenu((key) => {
|
electron.onMenu((key) => {
|
||||||
console.log('menu', key)
|
console.log('menu', key)
|
||||||
if(key==='connect') {
|
if (menuActions[key]) {
|
||||||
store.setConnected(!store.connected)
|
menuActions[key]()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@@ -46,11 +46,13 @@
|
|||||||
<MenubarItem class="flex justify-between" @click="store.cycleScreenOrientation">
|
<MenubarItem class="flex justify-between" @click="store.cycleScreenOrientation">
|
||||||
<p>Orientation: </p>
|
<p>Orientation: </p>
|
||||||
<p>{{ store.screenOrientation }}°</p>
|
<p>{{ store.screenOrientation }}°</p>
|
||||||
|
<MenubarShortcut>⌘R</MenubarShortcut>
|
||||||
</MenubarItem>
|
</MenubarItem>
|
||||||
<MenubarSeparator />
|
<MenubarSeparator />
|
||||||
<MenubarItem class="flex justify-between" @click="store.switchPreviewDeviceModel">
|
<MenubarItem class="flex justify-between" @click="store.switchPreviewDeviceModel">
|
||||||
<p>Skin: </p>
|
<p>Skin: </p>
|
||||||
<p>{{ previewDeviceNames[store.previewDeviceModel || 'nanoOne'] }}</p>
|
<p>{{ previewDeviceNames[store.previewDeviceModel || 'nanoOne'] }}</p>
|
||||||
|
<MenubarShortcut>⌘S</MenubarShortcut>
|
||||||
</MenubarItem>
|
</MenubarItem>
|
||||||
<MenubarSeparator />
|
<MenubarSeparator />
|
||||||
<MenubarItem>{{ $t('navbar.device.export') }}
|
<MenubarItem>{{ $t('navbar.device.export') }}
|
||||||
|
|||||||
@@ -28,6 +28,8 @@ const appMenu = {
|
|||||||
submenu: {
|
submenu: {
|
||||||
connect: { label: 'Connect', shortcut: 'CmdOrCtrl+D' },
|
connect: { label: 'Connect', shortcut: 'CmdOrCtrl+D' },
|
||||||
nextDevice: { label: 'Next Device', shortcut: 'CmdOrCtrl+N' },
|
nextDevice: { label: 'Next Device', shortcut: 'CmdOrCtrl+N' },
|
||||||
|
orientation: { label: 'Orientation', shortcut: 'CmdOrCtrl+R' },
|
||||||
|
skin: { label: 'Skin', shortcut: 'CmdOrCtrl+S' },
|
||||||
export: { label: 'Export Settings', shortcut: 'CmdOrCtrl+E' },
|
export: { label: 'Export Settings', shortcut: 'CmdOrCtrl+E' },
|
||||||
import: { label: 'Import Settings', shortcut: 'CmdOrCtrl+I' },
|
import: { label: 'Import Settings', shortcut: 'CmdOrCtrl+I' },
|
||||||
quit: { label: 'Quit', shortcut: 'CmdOrCtrl+Q', action: () => app.quit() },
|
quit: { label: 'Quit', shortcut: 'CmdOrCtrl+Q', action: () => app.quit() },
|
||||||
|
|||||||
Reference in New Issue
Block a user