-3

I need to run a C or Matlab program at the bottom of windows running programs to move mouse, like using image processing to move mouse pointer. how can i move mouse with a set of codes and how can i click right and left???

Alex
  • 177
  • 1
  • 4
  • 10

1 Answers1

0

You can use the Java Robot class directly from Matlab quite easily; something like:

robot = javaObjectEDT('java.awt.Robot');
robot.mouseMove(100, 200);
robot.mousePress(16);
robot.mouseRelease(16);

The parameters to mousePress and mouseRelease are constant values from InputEvent. You can find their values here, and the documentation here tells you which constants to use (e.g. BUTTON1_MASK, or left-click, is 16).

Richante
  • 4,353
  • 19
  • 23