How to detect if the user has pressed the mouse button anywhere on the screen?

1 view (last 30 days)
In my GUI application, I want to reset a time variable when the mouse button is pressed anywhere on the screen. The idea is to detect if a user is actively working with the application or not. I have tried using the main figure's property WindowsButtonDownFcn . However, the WindowsButtonDownFcn is not activated when the user presses on a uicontrol on the figure, such as a push button. How can I reset my time variable by mouse click regardlessly of which object is under the pointer?
Many thanks
Fredrik

Answers (0)

Categories

Find more on Migrate GUIDE Apps in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!