UPD: Make auto select optional

This commit is contained in:
Robert Kossessa
2024-06-01 19:14:41 +02:00
parent a9280af366
commit c30ec25218
3 changed files with 12 additions and 3 deletions

View File

@@ -46,7 +46,8 @@ export const useAppStore = defineStore('app', {
},
previewDeviceModel: localStorage.getItem('previewDeviceModel') || 'nanoOne',
profileManagerDragging: false,
showProfileConfig: false
showProfileConfig: false,
selectOnInput: false
}
},
getters: {
@@ -76,6 +77,9 @@ export const useAppStore = defineStore('app', {
setShowProfileConfig(show) {
show = false // TODO: Remove this / replace with actual logic
this.showProfileConfig = show
},
toggleSelectOnInput() {
this.selectOnInput = !this.selectOnInput
}
}
})

View File

@@ -80,6 +80,11 @@
<p>{{ previewDeviceNames[appStore.previewDeviceModel || 'nanoOne'] }}</p>
<MenubarShortcut>S</MenubarShortcut>
</MenubarItem>
<MenubarItem class="flex justify-between" @click="appStore.toggleSelectOnInput">
<p>Auto Select:&nbsp;</p>
<p>{{ appStore.selectOnInput ? 'On' : 'Off' }}</p>
<MenubarShortcut>K</MenubarShortcut>
</MenubarItem>
<MenubarSeparator />
<MenubarItem
>{{ $t('navbar.device.export') }}

View File

@@ -703,12 +703,12 @@ export const initializeDevices = () => {
}
if (update.p !== undefined) {
deviceStore.setPosition(update.p)
appStore.selectConfigFeature('knob')
if (appStore.selectOnInput) appStore.selectConfigFeature('knob')
}
if (update.kd !== undefined) {
const keyLabel = deviceStore.keyLabels[update.kd]
deviceStore.keyStates[keyLabel] = true
appStore.selectKey(keyLabel)
if (appStore.selectOnInput) appStore.selectKey(keyLabel)
}
if (update.ku !== undefined) {
deviceStore.keyStates[deviceStore.keyLabels[update.ku]] = false