Hey guys,
I noticed this was a recurrent problem, and the solutions I found were often not elegant and broken or incomplete. So I wrapped it all up in an easy to install through pip package.
You can find it on my Github repo here
Example usage:
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',
})