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