mirror of
https://github.com/ayangweb/BongoCat.git
synced 2026-03-12 17:51:48 +08:00
fix: 修复在切换至标准模式后,方向键未正确释放的问题 (#270)
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import type { Ref } from 'vue'
|
||||
|
||||
import { useDebounceFn } from '@vueuse/core'
|
||||
import { reactive, ref } from 'vue'
|
||||
import { reactive, ref, watch } from 'vue'
|
||||
|
||||
import { LISTEN_KEY } from '../constants'
|
||||
|
||||
@@ -49,6 +49,10 @@ export function useDevice() {
|
||||
const pressedKeys = ref<string[]>([])
|
||||
const catStore = useCatStore()
|
||||
|
||||
watch(() => catStore.mode, () => {
|
||||
pressedKeys.value = pressedKeys.value.filter(key => !key.endsWith('Arrow'))
|
||||
})
|
||||
|
||||
const debounceCapsLockRelease = useDebounceFn(() => {
|
||||
handleRelease(pressedKeys, 'CapsLock')
|
||||
}, 100)
|
||||
|
||||
Reference in New Issue
Block a user