feat: publish HoloLake model-native living system source

This commit is contained in:
冰朔 2026-08-03 10:04:41 +08:00
commit c395dd3a99
2467 changed files with 615073 additions and 0 deletions

View file

@ -0,0 +1,20 @@
import { useEffect, useEffectEvent } from 'react'
import { handleAppKeyboardEvent } from './appKeyboardShortcuts'
import type { KeyboardActions } from './appKeyboardShortcuts'
export type { KeyboardActions } from './appKeyboardShortcuts'
export function useAppKeyboard(actions: KeyboardActions) {
const onKeyDown = useEffectEvent((event: KeyboardEvent) => {
handleAppKeyboardEvent(actions, event)
})
useEffect(() => {
const handleWindowKeyDown = (event: KeyboardEvent) => {
onKeyDown(event)
}
window.addEventListener('keydown', handleWindowKeyDown, true)
return () => window.removeEventListener('keydown', handleWindowKeyDown, true)
}, [])
}