MATLAB Answers

Teemu

How to register where the mouse button is pressed?

Asked by Teemu
on 21 Feb 2013

Hi! I have picture and I want to know where the mouse button is pressed. For example in picture there are some objects and I want to know if I press a button on the object. How can I do it? I appreciate your help.

  0 Comments

Products

No products are associated with this question.

1 Answer

Answer by Sean de Wolski
on 21 Feb 2013
 Accepted answer

Set The object's ButtonDownFcn to register the event and get the axes' 'CurrentPoint' if you need more information about where. I recommend getting started here:

http://blogs.mathworks.com/videos/2011/03/29/graphics-challenge-for-new-users/

  0 Comments


Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply today