Using window button motion fcn even when mouse doesn't move

4 ビュー (過去 30 日間)
Zohar Bromberg
Zohar Bromberg 2018 年 1 月 1 日
コメント済み: Walter Roberson 2018 年 1 月 7 日
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
Walter Roberson 2018 年 1 月 1 日
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
Zohar Bromberg 2018 年 1 月 7 日
Thanks, but now the callbacks (from the timer and window button motion) interrupt each other. Every time the mouseMove callback is called I cleared the current drawing of the mouse and draw it again. but since they interrupt each other I get more than one drawing of the mouse. do you know how can I make sure that I call only 1 function at a time?
Walter Roberson
Walter Roberson 2018 年 1 月 7 日

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeCreating, Deleting, and Querying Graphics Objects についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by