function createHeldKeys(): () => string[];
Defined in: createHeldKeys.ts:26
SolidJS primitive that returns a signal of currently held keyboard keys.
This primitive uses useStore from @tanstack/solid-store to subscribe to the global KeyStateTracker and updates whenever keys are pressed or released.
Signal accessor for array of currently held key names
(): string[];
string[]
function KeyDisplay() {
const heldKeys = createHeldKeys()
return (
<div>
Currently pressed: {heldKeys().join(' + ') || 'None'}
</div>
)
}