Trigger button with custom shortcut

Hey. guys!

Feeling super dumb. :smiley:

I want to trigger button with custom shortcut.

E.g. when user press "j" i want app to act like button "DoSomething" is clicked. How to to that? :smiley:

1 Like

Hey @Andrzej_Slowik! Welcome back to the community. :slightly_smiling_face:

You should be able to define custom shortcuts via the App inspector.

Hey @Darren ! know this. ; -)

but I need in here to trigger a button – and i can't put this to work

e.g.

button.trigger() not working and I'm quite not sure how to handle this. :slight_smile:

Ah got it - just wanted to be sure. :sweat_smile:

As far as I know, there isn't a way to explicitly press a button via a JS script. Is there a reason that you don't want to just trigger the same queries and/or code blocks that are attached to the button? I can certainly see that it might be cumbersome if you have a lot of handlers, but I'm a proponent of coordinating them all within a single JS query, anyway.