Trying to perform multiple Mouse click using java robot but need more help.
4 次查看(过去 30 天)
显示 更早的评论
Trying to perform multiple Mouse click using java robot but not working Inbetween the two clicks, the menu opened by the one click is disappeared for the next clicks. I think it is due to shift between the script file and the model where i am applying the code.
Is there any way where i can retain the menus opened by the clicks for further processing?
The code is as below:
import java.awt.Robot
import java.awt.event.*
mouse = Robot;
open_system('asdf');
Position1 = 350;%Predefined position for a block in the model
Position2 = 816;
% To perform right click and get the menu(works fine)
mouse.mouseMove(349, 1024-816);
mouse.mousePress(InputEvent.BUTTON3_MASK);
mouse.mouseRelease(InputEvent.BUTTON3_MASK);
%To click on one of the item in the menu. But by this time the menu opened by %first click disappears
mouse.mouseMove(Position1+85, 1024-Position2+8);
mouse.mousePress(InputEvent.BUTTON1_MASK);
mouse.mouseRelease(InputEvent.BUTTON1_MASK);
0 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Aerospace Applications 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!