Key Stroke
Listen for keyboard key being stroked.
# API
# KeyStrokeConfig
| Property | Description | Default |
|---|---|---|
key |
true | string | string[] | FunctionList of key(s) or predicate that trigger handler. |
— |
handler |
(event: KeyboardEvent) => voidUtility function that is called when the key is being stroked. |
— |
eventName? |
keydown | keypress | keyupThe specified event to listen. |
keydown |
target? |
EventTargetTarget to attach the event listener. |
document |
passive? |
booleanAdd event listener passive parameter. |
false |
preventDefault? |
booleanWhether to preventDefault before calling handler. |
false |
autoStop? |
booleanWhether to remove listener when hosting component is destroyed. |
true |