Keyboard shortcuts
See original GitHub issueProblem
I’m more productive when I can use keyboard shortcuts. E.g. press left/right to move to previous / next image. Press space to toggle some viz. Press j/k to move up/down some slider.
Solution
MVP: Provide a way to map 80% of the keys to custom actions. It could be an optional argument to streamlit.button
, streamlit.slider
(two keys for up/down one step), etc.
Possible additions: Allow to map most keys, inclluding remapping ‘c’ which currenty clears the streamlit cache.
Additional context
Comes form personal need. Also mentioned here: https://discuss.streamlit.io/t/idea-keyboard-bindings/1976 .
Community voting on feature requests enables the Streamlit team to understand which features are most important to our users.
If you’d like the Streamlit team to prioritize this feature request, please use the 👍 (thumbs up emoji) reaction in response to the initial post.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:25
- Comments:28 (3 by maintainers)
Top GitHub Comments
Small update, I continued looking for ways to make @andfanilo hacky solution more robust and I think it is good enough now. Now I get the buttons based on their labels. First I get all buttons then check their labels until I find the desired button. Here is the code of the full proof of concept, also published in a gist
Hey @albusdemens and @Pashtetickus. Apologies for the delayed response.
You can uninstall your current streamlit, then download this
whl
I built and install it: https://github.com/louislva/streamlit/blob/develop/builds/streamlit-1.3.2-py2.py3-none-any.whlThat way you don’t have to set up the build environment. Hope it’s helpful.