Keyboard shortcuts trigger key / combo

I am posting to inquire about the custom keyboard events.

Do they use Mousetrap underneath the hood? If so, is there any access for us to have the combo as shown here?

I had the idea for a user to be able to jump to a specific "step" of a stepped view container. This would need the keyboard shortcut, lets say typing v 4 to go to the fourth pane. I don't want to register individual callbacks for each number, so its there a way to do something like....

letting the trigger box accept arrays like shown here?
image

If it could take arrays, then we could something like this in the trigger box...

{{ container1.views.map((_, i) => `v ${i+1}`) }}

and something like this in the action box!

container1.setCurrentViewIndex(combo.split(" ")[1] - 1)
// where combo is defined like above and would be "v 1", "v 2"...

right?

I think it would work... if you are indeed using Moustrap :joy:

We use use react-shortcuts which appears to use combokeys internally which is a forked version of mousetrap. So in a roundabout way, yes? I made a ticket for this. This would definitely be a fun feature to have! Shoutout to @bca for looking into this one!

1 Like