Trying to perform multiple Mouse click using java robot but need more help.

4 Ansichten (letzte 30 Tage)
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);

Antworten (0)

Kategorien

Mehr zu Aerospace Applications finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by