本页还没有译文
本页 8 段还没译成Русский,下面显示的是英文原文。useHeldKeys
还没翻译译自英文(tanstack.com)本页 8 段都还没译
function useHeldKeys(): string[];Defined in: useHeldKeys.ts:26
React hook that returns an array of currently held keyboard keys.
This hook uses useSelector from @tanstack/react-store to subscribe
to the global KeyStateTracker and updates whenever keys are pressed
or released.
Returns
string[]
Array of currently held key names
Example
function KeyDisplay() {
const heldKeys = useHeldKeys()
return (
<div>
Currently pressed: {heldKeys.join(' + ') || 'None'}
</div>
)
}AI 翻译查看英文原文