View Full Version : Help to define mouse areas
splash
2nd July 2009, 07:46 AM
Hi,
I would like to define three screen areas for moving the mouse within them, every one activated with a different button. I'm using Jane's F-15 and the problem is that the mouse can be moved in the whole screen. The idea is to define an area in the HUD activated with HAT1 Up, another in the Left MFD with HAT1 Left and the last one in the Right MFD with HAT1 Right.
Could you please tell me some suggestion of a script for that?
Thank you very much.
Bob Church
3rd July 2009, 03:49 AM
Hi splash.
You could do that if the CMCC works for you (it's part of the CM install). Some systems seemt to have trouble with it during hibernation. If you normally power down though, you're normally good to go. It doesn't work with all sims, either
You should probably have a look at for some background first. It explains how the variables work. The basic code would look something like the for a FighterStick:
script
// Set for a 100 x 100 centered at 150, 150. JS1.B8 will take you
// the center.
//
if( js1.b8 ) then
SCREENX = 150;
SCREENY = 150;
endIf
// Set up a second 100 x 100 zone centered 300, 300. JS1.B4 gets
// you to the middle of this one.
//
if( js1.b6 ) then
SCREENX = 300;
SCREENY = 300;
endIf
endScript
That would put the cursor in the right zone, but it wouldn't prevent you from moving the mouse outside the zone. You'd need to set up some kind of limiter to do that it it were a problem, basically checking the positions and pushing them back to the zone edges. Probably easier just to "don't do it". :)
There are no assignments made to the CMS controls, actually there are no assignements made in the GUI at all. The SCREENX and SCREENY fuctions handle it all, but you need the CMS Controls to get access to the map.
Limiting it so it stayed in the zone would be a little more work, mainly checking the zone boundaries every the mouse moved and if it had crossed the zone edge, just force it back.
Best regards,
- Bob
The StickWorks
[url]http://www.stickworks.com (http://home.att.net/~stickworks/cmccscreen.htm this page of the Users guide [/url)
Powered by vBulletin® Version 4.1.4 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.