Skip to content

The useRecordHotkeys hook should allow us to programatically set the keys #1139

Closed
@christianlundberg

Description

@christianlundberg

Is your feature request related to a problem? Please describe.
It's currently impossible to update the value of the keys while recording a shortcut.

Describe the solution you'd like
The useRecordHotkeys could also return a setKeys function which we could use to programatically change the value of the keys.

const [keys, { setKeys }] = useRecordHotkeys();

const onChangeKeys = () => {
    setKeys(new Set(['ctrl']));
};

Describe alternatives you've considered
I've resorted to mutating the Set of keys, which is a bad practice in React.

Additional context
Add any other context or screenshots about the feature request here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions