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

Allow to control when keyboard shortcuts are active. #819

Open
mathieu-fournier opened this issue May 2, 2024 · 0 comments
Open

Allow to control when keyboard shortcuts are active. #819

mathieu-fournier opened this issue May 2, 2024 · 0 comments
Labels
needs triage requires further investigation before proceeding with implementation react Issue related to React

Comments

@mathieu-fournier
Copy link
Contributor

Is your feature request related to a problem? Please describe.

I want to have keyboard shortcuts to do many things in my application. Some of these things require the focus to be on certain elements. Example : Delete key shortcut to delete selected elements.
The problem is that keyboard shortcuts are not executed because, when elements are selected, the boolean flag 'isFocusOnHome' is false.

The thing is that most shortcuts must require some kind of context to perform an action. "Ex: having a tool active, having some element selected, etc...".
The 'focus on home' check prevents shortcuts from being used.
It's also counter intuitive mixed with the isActive boolean flag.
So, instead of a boolean flags like isFocusOnHomeRequired and isActive, I suggest we put a predicate function so the user can control when the shortcut is active. The predicate could default to the usual isFocusOnHome check.

Describe the Solution you'd like

Letting the user decide when a keyboard shortcut is active.

Describe alternatives you've considered

See discussion : #804

Additional context

No response

@GerardasB GerardasB added react Issue related to React needs triage requires further investigation before proceeding with implementation labels Aug 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs triage requires further investigation before proceeding with implementation react Issue related to React
Projects
None yet
Development

No branches or pull requests

2 participants