Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
christianlundberg opened this issue Feb 13, 2024 · 1 comment

Comments

@christianlundberg
Copy link

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.

@JohannesKlauss
Copy link
Owner

What is your use case for that functionality?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants