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,34 @@
import { useEffect } from 'react'
/**
* Registers mouse button 3/4 (back/forward) navigation.
* The horizontal trackpad swipe path was removed because it was firing
* unreliably in WKWebView and conflicted with the explicit keyboard path.
*/
export function useNavigationGestures({
onGoBack,
onGoForward,
}: {
onGoBack: () => void
onGoForward: () => void
}) {
useEffect(() => {
const handleMouseNavigation = (event: MouseEvent) => {
if (event.button === 3) {
event.preventDefault()
onGoBack()
return
}
if (event.button === 4) {
event.preventDefault()
onGoForward()
}
}
window.addEventListener('mouseup', handleMouseNavigation)
return () => {
window.removeEventListener('mouseup', handleMouseNavigation)
}
}, [onGoBack, onGoForward])
}