0

I have made an application which control my mouse coordinate on screen with the usual

Robot mouseControler ;
try {
mouseControler = new Robot();
} catch (AWTException e) {
e.printStackTrace();
}

mouseControler.mouseMove(newRenderedPos.x,newRenderedPos.y);

It is perfectly working on my desktop, but if I start to use some specific full screen application it acts weirdly :

On MAME Emulator, it just don't work, while it is with my normal mouse (my program is just ignored).

On Virtual Cop 2 (PC version) the game seems to move beyond the coordinate. If the robot is sending coordinate 0.1,0.1, then instead of moving the mouse at 0.1,0.1 coordinate on screen like on the desktop, it is moving the mouse from 0.1,0.1 (moving down,right a little bit).

What is the problem and how could I fix this ?

eltabo
  • 3,749
  • 1
  • 21
  • 33
Orion
  • 301
  • 3
  • 12
  • I am unsure if this is your problem, but any fullscreen apps that run at a smaller resolution than desktop (Virtual Cop? MAME?) will have a different set of co-ordinates than desktop, so your mouse will not go where you want it. The solution would be to check if there is a different fullscreen resolution and then scale your X/Y co-ordinates accordingly. – sorifiend Jan 31 '14 at 02:23
  • That happen in House of the Dead 1 (which have a really low resolution), but I can handle it with my app. The real problem is the Java Robot is not working at all on MAME and act differently on Virtual Cop 2 as described above – Orion Jan 31 '14 at 14:11

1 Answers1

0

My comment got to big, so posting it here.

For "Virtual Cop 2":

If your program works correctly in windows then there is a good chance that the solution is the same as what you did for "House of the Dead 1", its probably a resolution issue (or a rounding issue with Integers and Doubles?).

For MAME its not so easy:

Before you read on please try the link below, if that doesn't work then: From what you say and a quick look on the MAME site it uses its own virtual control system so that older games work correctly. So if that is correct then MAME is independent of the windows controls and a Robot class wont work properly or at all, unless you can find out how MAME uses the mouse and then write some specific code just for MAME.


This may fix your problem with MAME, click the link for more info:

Why doesn't my mouse or trackball work? (Taken from the MAME site):

  • The most common solution is, in mame.ini, replace "mouse 0" with mouse 1
sorifiend
  • 5,927
  • 1
  • 28
  • 45