PDA

View Full Version : Move mouse cursor to IL2 Map



Mag_Maverick
7th October 2009, 10:14 PM
Have tried to get the following script created by Sieben to work. My understanding of the script is it should display the map and move the mouse cursor to the map inorder to initiate zooming.

Outside IL2 the mouse moves to the upper right-hand corner of the screen. Inside IL2, the map displays but the mouse cursor remains in it's original position. An earlier post mentioned setting mouseuse=1 in the IL2 conf.ini file. Neither mouseuse=1 or mouseuse=2 works.

Button 1 on the ProThrottle is set to display the map. CMS Button 2 is set to DirectX Device=Mouse and DirectX Control=Button 1. CMS Button 3 is set to DirectX Device=Mouse and DirectX Control=Button 2

// CMS Script File
//
// Game Title:
// Written By:
// Date:
//
script
SEQUENCE //********MOUSE POINTER MOVE SCRIPT*********
WAIT( JS2.B1 ); // Wait for button 1 to be pressed on the Pro Throttle
DELAY( 3 ); // Wait approx an eighth of a second
SCREENX=900; // Move cursor to map pop up window
SCREENY=200;
DELAY( 3 ); // Wait approx an eighth of a second
CMS.B2 = TRUE; // Left Mouse Button is held down
WAIT( JS2.B1 ); // Wait for button 1 to be pressed again on the Pro Throttle
DELAY( 3 ); // Wait approx an eighth of a second
CMS.B2 = FALSE; // Left Mouse button is released
DELAY( 3 ); // Wait approx an eighth of a second
SCREENX=1016; // Move cursor out of view
SCREENY=760;
DELAY( 3 ); // Wait approx an eighth of a second
ENDSEQUENCE
endScript

Using Control Manager v4.51, Vista x64.

Any help with be greatly appreciated!

MM

Bob Church
7th October 2009, 11:06 PM
Hi Mag_Maverick,

Do you have the CMCC running? The SCREENX and SCREENY commands depend on it for the information. There's some more information HERE (http://home.att.net/~stickworks/cmccscreen.htm) that talks about it a little.

Best regards,

- Bob

The StickWorks
http://www.stickworks.com

Mag_Maverick
8th October 2009, 12:20 AM
Hi Bob,

CMCC is running...the CMCC icon is in my system tray. Also verified in Task Manager.

Thanks for the quick response.


MM

Bob Church
8th October 2009, 12:42 AM
Hi Mag_Maverick,

Okay. I took a look at the script and I don't see anything really wrong there. The throttle would need to be on the JS2 tab (from left to right they're "Program Settings", then the first controller that was added to the map (JS1), then the second controller that was added (JS2) and so on, if the PT isn't on the right tab it will be looking at another controller.

If that's not the case, I'm not really sure what it might be. It would be dependent on screen size but that shouldn't jam the cursor in the corner, and top/right is a little strange anyway. Usually when something is wrong in the mouse script, the map ends up sending zeros to for the X and Y which will jam it top/left rather than top/right.

If it's not in the way the tabs are set up, could you attach the MAP, CMS, and any CMC files to a reply so I can load it up and take a look?

Best regards,

- Bob

The StickWorks
http://www.stickworks.com

Mag_Maverick
8th October 2009, 01:28 AM
Bob,

I've attached the original zip file posted by Sieben on the CH site. It has all of the files you requested.

Thanks,
MM

Bob Church
8th October 2009, 09:14 AM
Hi Mag_Maverick,

Got it. I loaded it up in XP32 and it seems to do what it's supposed to, when I push in on the ministick the cursor jumps to 900, 200 and 1016, 760. The mouse clicks seem to be happening correctly, too.

The script looks to be set up for a 1024 x 768 display. If you're running at less resolution than that, then it jumps not actually hard into the top right corner but hard right and 200 pixels down. The command is to go to 900 pixels right and 200 pixels down. If I set it to 800 x 600, then I get a hard right cursor, but it's not really at the top. It's down by 200 pixels. The toggle back sends it to 1016, 760 which is completely offscreen in 800 x 600 but essentially down itn the lower right corner.

Are you using something less than 1024 x 768? If so, you need to change those coordinate pairs in the script to match where you actually want it to go. The easiest way is probably to do a screen capture of the IL2 screen if you can, then load it up in a paint program and check the coordinates. The 900, 200 has to match the screen. The 1016, 760 is apparently just to get the cursor almost out of sight, on 800 x 600 it would end up being 792, 592 (8 less than X and Y max).

Would that explain it?

Best regards,

- Bob

The StickWorks
http://www.stickworks.com

Mag_Maverick
12th October 2009, 04:18 PM
Don't think this a screen resolution problem as I run IL2 and my desktop in 1024 x 768. I believe the problem is with Vista x64. I understand that Vista x64 handles "Full Screen" mode different from XP. I'm not sure if the problem lies with Vista x64 or the nVidia drivers for x64. I became aware of this several months ago researching a different problem with running IL2 in "Full Screen" mode on Vista x64. Windows screen prints to the clipboard do not work in IL2 "Full Screen" mode" with Vista x64. You get a blacked out image when you paste the results of a windows screen print to a graphics program like MS Paint, etc. Windows screen print will work outside of IL2. IL2's screenprint does work but it creates .tga file in the IL2 folder which require additional software to convert to other usable formats. Searching the internet, I found several experiencing this same problem but no solution. The only thing I remember finding is that Vista X64 or the nVidia drivers handled "Full Screen" mode differently, but I cannot remember the reasons for the difference.

Seiben's script does work on my Vista x64 on my desktop outside of IL2. Running IL2 in OpenGL or Directx does not make a difference. I do not know if the problem also occurs in Vista x32, XP x64, Windows 7 x32 and x64. Maybe someone in our CH network can check this if they use these Widows systems.

Although I have no solutions, I'm posting this response so that it my assit others who have experenced similar problems.

Anyway, THANKS for your help Bob!

MM

Bob Church
12th October 2009, 08:08 PM
Hi Mag_Maverick,

You're quite welcome, sir! I'm sorry it didn't fall into line for you.

I hadn't heard that about the screen thing with Vista. Thanks for the information! If that's what's happening, there's not much to be done about it. You sort of have to live with what Windows hands you with that sort of thing unfortunately.

On the bright side, it did move the cursor "somewhere" according to your original post, so it's seeing and responding to the commands. Maybe a little trial-and-error. Cut the values in half and just send the cursor movement commands, don't actually do anything when it gets there so you can see where it went. See where it lands and then adjust the values, download again, and see how it changed. You might be able to just "feel" your way over to where it needs to go.

Good luck with it! If anything else interesting turns up, let us know!

Best regards,

- Bob

The StickWorks
http://www.stickworks.com