Using window button motion fcn even when mouse doesn't move
이전 댓글 표시
I want to use the window button motion fcn every so and so ms and not when the mouse moves. or, any other way to call the mousemove function on specific time. How can I do it? Thank you
답변 (1개)
Walter Roberson
2018년 1월 1일
0 개 추천
You can create a timer object that calls the callback.
Note that you will need to pass the figure object as the first parameter of the callback so that the callback can count upon hObject (also known as src) as per the usual default parameters for callbacks.
I would suggest that you should consider having the window button motion callback call into a function to do the real work, and that you have the timer callback call that same function, instead of bothering to fake the callback.
댓글 수: 4
Zohar Bromberg
2018년 1월 4일
편집: Walter Roberson
2018년 1월 4일
Walter Roberson
2018년 1월 4일
t.TimerFcn = @(src, event) mouseMove(hf, [])
assuming that mouseMove is programmed as a normal callback like
function mouseMove(hObject, eventdata)
Zohar Bromberg
2018년 1월 7일
Walter Roberson
2018년 1월 7일
Try setting the figure Interruptible property; https://www.mathworks.com/help/matlab/ref/matlab.ui.figure-properties.html#property_d119e285342
카테고리
도움말 센터 및 File Exchange에서 Startup and Shutdown에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!