Trigger an event as long a the right mouse presses a button down

Hello together,

I´m looking for a way to trigger an event as long as the right mouse presses a button down. After releasing the mouse, the event shall stop. The on_click method only triggers when the mouse click ended. But I think there should be a way to do so since the buttons changes their background color while pressing the right mouse down.

The reason to find a solution is to implement a remote control for a robot.

Thanks in advance!

Hi @Jan-Luca_Kirchler,

Thanks for sharing this question!

Streamlit does not natively support events for mouse button presses and releases. It’s built around higher-level abstractions such as button clicks and other elements. However, you could find a solution by creating a custom Streamlit component; more info on how to create one here.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.