Closed github-actions[bot] closed 4 months ago
Instead of
import streamlit as st
from streamlit_shortcuts import add_keyboard_shortcuts
def delete_callback():
st.write("DELETED!")
st.button("delete", on_click=delete_callback)
add_keyboard_shortcuts({
'Ctrl+Shift+X': 'delete',
})
It can be:
import streamlit as st
from streamlit_shortcuts import button
def delete_callback():
st.write("DELETED!")
streamlit_shortcuts.button("delete", on_click=delete_callback, shortcut,="Ctrl+Shift+X")
https://github.com/adriangalilea/streamlit-shortcuts/blob/bfca99129ff68cb85987673cfe24d73d2da552c0/src/streamlit_shortcuts/streamlit_shortcuts.py#L5