Skip to main content
Version: 4.0

useRecordHotkeys API

Function signature:

function useRecordHotkeys(): [Set<string>, { start: () => void, stop: () => void, isRecording: boolean }]

Return value

const [keys, { start, stop, isRecording }] = useRecordHotkeys()

keys

A Set of the keys that have been pressed.

start

A function that starts recording the keys that are pressed. Only works in the browser.

stop

A function that stops recording the keys that are pressed. Only works in the browser.

isRecording

A boolean that indicates whether the recording is in progress or not.