(props: KeyboardProps)
| 27 | * Handles keyboard interactions for a focusable element. |
| 28 | */ |
| 29 | export function useKeyboard(props: KeyboardProps): KeyboardResult { |
| 30 | return { |
| 31 | keyboardProps: props.isDisabled |
| 32 | ? {} |
| 33 | : { |
| 34 | onKeyDown: createEventHandler(props.onKeyDown), |
| 35 | onKeyUp: createEventHandler(props.onKeyUp) |
| 36 | } |
| 37 | }; |
| 38 | } |