help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: automating GUI with java robot on Octave


From: Rik
Subject: Re: automating GUI with java robot on Octave
Date: Tue, 4 Apr 2017 03:24:51 -0700 (PDT)

I am trying to do something similar (i.e. UI control in Octave with the Java
robot).

I want to send the key combination alt-space followed by x to maximize a
figure window (see code below). I have two problems:
- It does not seem to actually send the key combination (nothing visible
happens, but there is no error either)
- I can't get the key IDs from java.awt.event.KeyEvent

If anyone has an idea of how to solve this, I'dd be much obliged.

My code (snippet) so far:
(I use single quotes for strings, because otherwise Matlab start
complaining)

%hardcoded values from java.awt.event.KeyEvent
VK_ALT=18;
VK_SPACE=32;
VK_X=88;

figure(hFig)
robot = javaObject('java.awt.Robot');
javaMethod('keyPress',robot,VK_ALT);     %// send ALT
javaMethod('keyPress',robot,VK_SPACE);   %// send SPACE
javaMethod('keyRelease',robot,VK_SPACE); %// release SPACE
javaMethod('keyRelease',robot,VK_ALT);   %// release ALT
javaMethod('keyPress',robot,VK_X);   %// send X
javaMethod('keyRelease',robot,VK_X); %// release X




--
View this message in context: 
http://octave.1599824.n4.nabble.com/automating-GUI-with-java-robot-on-Octave-tp4682338p4682736.html
Sent from the Octave - General mailing list archive at Nabble.com.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]