MATLAB: Recording of mouse position and continued display of updating of mouse position.

buttondownfcnwindowbuttonmotionfcn

Hi, I want my GUI to continuously display the current position of the mouse cursor. By clicking the left mouse button, I want this position value to be fixed shown in a nearby text box. I have managed both parts separately: Using WindowButtonMotionFcn the position is always displayed (by following these instructions: http://www.mathworks.com/matlabcentral/answers/97563-how-do-i-continuously-read-the-mouse-position-as-the-mouse-is-moving-without-a-click-event). I have also managed to display the clicked position in an extra text field. The problem I experience is, that after clicking the first time, the continuous updating stops and cross hairs appear. The second click then is recorded in my text field and continuous updating resumes. How can I skip the 'first click'? I want my first mouse click to be recorded and I do not want the continuous display of the mouse position to cease at any time. How do I do this? Thank you!

Best Answer

I solved it. I used evalin function to import the cursor data from the external mouseMove function and dropped ginput function entirely.
Related Question