https://github.com/marimo-team/gallery-examples/blob/main/notebooks/wigglystuff/keystroke.py
Click the widget, then press any key combination (e.g. Ctrl + Shift + P). The latest shortcut is synced to Python through the last_key trait.
Ctrl + Shift + P
last_key
—