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!