St.button keybindings

Hey Fellas,

is there a way to set keybindings (similar to R for rerun) on buttons?
st.button(“click”, keybinding=“enter”)

Best regards
Chris

2 Likes

There isn’t, but I feel like I’ve heard this request before. There might be some discussion on the GitHub issues about this, or if not, creating an issue is a good idea.

2 Likes

Yeah I think I saw something related too on GH

The “Using Component to bind keyboard shortcut” … shouldn’t totally work, as the shortcut would be limited to the zone of the iframe container for the component.
But actually I’m not sure, maybe we could escape the iframe sandbox to capture keyboard events on the whole app instead of only the component iframe.

(still, st.button(“click”, keybinding=“enter”) wouldn’t be easily possible, you should def. add that to the GH feature request :wink: )

Something to test one day :wink:
Fanilo

1 Like

Great guys, thanks for your replies :slight_smile: .