Mouse and Keyboard control in Matlab
http://docs.oracle.com/javase/1.5.0/docs/api/java/awt/Robot.html
import java.awt.Robot;
mouse = Robot;
mouse.mouseMove(0, 0);
screenSize = get(0, 'screensize');
for i = 1: screenSize(4)
mouse.mouseMove(i, i);
pause(0.01);
end
import java.awt.Robot;
import java.awt.event.*;
mouse = Robot;
mouse.mousePress(InputEvent.BUTTON3_MASK);
mouse.mouseRelease(InputEvent.BUTTON3_MASK);
resoure-http://www.mathworks.in/support/solutions/en/data/1-2X10AT/index.html?solution=1-2X10AT
void | keyPress(int keycode)
Presses a given key. |
void | keyRelease(int keycode)
Releases a given key. |
void |
delay(int ms)
Sleeps for the specified time. |
int |
getAutoDelay()
Returns the number of milliseconds this Robot sleeps after generating an event. |
Color |
getPixelColor(int x,
int y)
Returns the color of a pixel at the given screen coordinates. |
boolean |
isAutoWaitForIdle()
Returns whether this Robot automatically invokes waitForIdle
after generating an event. |
void |
keyPress(int keycode)
Presses a given key. |
void |
keyRelease(int keycode)
Releases a given key. |
void |
mouseMove(int x,
int y)
Moves mouse pointer to given screen coordinates. |
void |
mousePress(int buttons)
Presses one or more mouse buttons. |
void |
mouseRelease(int buttons)
Releases one or more mouse buttons. |
void |
mouseWheel(int wheelAmt)
Rotates the scroll wheel on wheel-equipped mice. |
void |
setAutoDelay(int ms)
Sets the number of milliseconds this Robot sleeps after generating an event. |
void |
setAutoWaitForIdle(boolean isOn)
Sets whether this Robot automatically invokes waitForIdle
after generating an event. |
String |
toString()
Returns a string representation of this Robot. |
void |
waitForIdle()
Waits until all events currently on the event queue have been processed. |
You can always see my work in this video in which I played counterstrike with hand gestures at end of video!!!!