Is it possible to detect a key press event ? #552
-
Is it possible to detect a key press event ?. I am trying to build a LLM data cleansing app and want to be able to press a button using a key press as opposed to a mouse click ? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
I'd recommend creating a web component: https://google.github.io/mesop/web_components/ - then you can detect a keypress event by writing JS code, e.g.
You can trigger an event from your web component which you can use to call a Python function (e.g. the on_click event handler or an extracted function). We've considered supporting keyboard shortcuts in a more first-class way in Mesop, but it'll take us some time to get there. |
Beta Was this translation helpful? Give feedback.
I'd recommend creating a web component: https://google.github.io/mesop/web_components/ - then you can detect a keypress event by writing JS code, e.g.
You can trigger an event from your web component which you can use to call a Python function (e.g. the on_click event handler or an extracted function). We've considered supporting keyboard shortcuts in a more first-class way in Mesop, …