Check if mouse button is pressed

Check if mouse button is pressed programatically

You are now following this Submission

This function helps you find out, programatically, if any mouse button is clicked.
This can be very useful when configuring 'SizeChangeFcn' callbacks, for instance, when you may need to execute a certain action ONLY once the user has released the mouse button.

Cite As

Mbvalentin (2026). Check if mouse button is pressed (https://www.mathworks.com/matlabcentral/fileexchange/61976-check-if-mouse-button-is-pressed), MATLAB Central File Exchange. Retrieved .

Acknowledgements

Inspired: Determine whether a key is up or down

General Information

MATLAB Release Compatibility

  • Compatible with any release

Platform Compatibility

  • Windows
  • macOS
  • Linux
Version Published Release Notes Action
1.1.0.0

Readme added

1.0.0.0