PDA

View Full Version : Possible to emulate the mouse wheel?


Wazoo
11-01-2004, 10:48 PM
I want to inplement the new BMS 1.03 FOV commands. Currently, they are mapped to the mouse wheel (my mouse does not have a wheel).

Is it possible to script it so the mini-stick on the throttle emulates the mouse wheel?

TIA,

Wazoo

Revvin
11-01-2004, 10:57 PM
I don't believe that its possible to emulate the mousewheel, perhaps and idea for this (http://www.ch-hangar.com/forum/index.php?showtopic=19) thread?

Revvin
11-01-2004, 10:58 PM
Hows the latest version of BMS look anyway? got any screenies? been looking for an excuse to fire up Falcon 4.0 again :)

Bob Church
11-01-2004, 11:34 PM
Wazoo,

>> I want to inplement the new BMS 1.03 FOV commands. Currently, they are mapped to the mouse wheel (my mouse does not have a wheel).

Is it possible to script it so the mini-stick on the throttle emulates the mouse wheel? <<

Try assigning a centering axis (like the ministice) to the Mouse Z axis. I don't have BMS, but it worked as a scroll wheel in WordView, Internet Explorer. It's set up a little differently than the other mouse axes. It generates one +/- Z count periodically based on the axis position. It stops at center, goes faster the further from center you move the stick.

You can probably simulate it without an axis is CMS. Use a CMS axis as the mouse Z axis, then use buttons to move the value up and down a little to control the scroll speed.

You could also use a switch to move whatever you've got assigned to the Y-axis to the Z axis, that way Y would control position unless the button was down, then it would do scroll rate. Something like:

script
cms.a1 = js1.a1;
if( js1.b4 ) then
cms.a2 = 128; // zero the Mouse Y
cms.a3 = js1.a2; // put data on Mouse Z
else
cms.a2 = js1.a2; // put mouse data on Mouse Y
cms.a3 = 128; // zero Mouse Z
endIf
endScript

and then assign Mouse X, Mouse Y, and Mouse Z to cms.a1, cms.a2, and cms.a3 respectively in the GUI. I'm not trying that at the moment, you may need to fiddle with it a little, but that should do it in theory.

Also, if anyone is feeling experimental, the mouse wheel will reportedly tune the radios, etc. in the later Flight Simulator versions.

Anyway, it's working here okay. I can scroll this page in IE with the FighterStick Y-axis as we speak.

- Bob

The StickWorks
http://www.stickworks.com

Wazoo
12-01-2004, 02:37 AM
Originally posted by Bob Church@Jan 11 2004, 10:34 PM


Try assigning a centering axis (like the ministice) to the Mouse Z axis. I don't have BMS, but it worked as a scroll wheel in WordView, Internet Explorer. It's set up a little differently than the other mouse axes. It generates one +/- Z count periodically based on the axis position. It stops at center, goes faster the further from center you move the stick.


Bob,

I've got it working.... sort of.

Here is my snippet of script:

IF ([JS2.A2 < 88] and (JS2.B3)) THEN
CMS.a1=JS2.a2; // Mousewheel
Endif
IF ([JS2.A2 > 168] and (JS2.B3)) THEN
CMS.a1=JS2.a2; //Mousewheel
Endif


CMS.B2 = [JS2.A1 < 88] and not (JS2.B3); // CURSOR LEFT
CMS.B3 = [JS2.A1 > 168] and not (JS2.B3); // CURSOR RIGHT
CMS.B4 = [JS2.A2 > 168] and not (JS2.B3); // CURSOR DOWN
CMS.B5 = [JS2.A2 < 88] and not (JS2.B3); // CURSOR UP

Basically, the mini-stick is doubling as a FOV zoomer (i.e. Mousewheel) when Shifted and as a TDC for my radar cursors when unshifted.

Unfortunately.... they are doing both things at the same time.

What am I doing wrong??

Also... any way to emulate the middle mouse button?

TIA!

Wazoo

Wazoo
12-01-2004, 05:01 AM
Originally posted by Revvin@Jan 11 2004, 09:58 PM
Hows the latest version of BMS look anyway? got any screenies? been looking for an excuse to fire up Falcon 4.0 again :)
So far I am very impressed. Between BMS and FF 2.1, it really is an impressive sim.

I always find myself drawn back to F4. Although I've been messing with LOMAC, it is still very buggy and does not feel like a living, breathing world yet; like F4.

There are a ton of screen shots at Frugals....

Bob Church
12-01-2004, 08:33 AM
Hi Wazoo,

>> IF ([JS2.A2 < 88] and (JS2.B3)) THEN
>> CMS.a1=JS2.a2; // Mousewheel
>> Endif
>>
>> IF ([JS2.A2 > 168] and (JS2.B3)) THEN
>> CMS.a1=JS2.a2; //Mousewheel
>> Endif

Well, CMS.A2 is assigned to Mouse Z, yes? And then you've got Mouse X and Mouse Y assigned to JS2.A1 and JS2.A2 respectively. If I'm wrong, let me know. Basically, the devil is in the details here. You're making the connection from the Ministick Y axis to CMS.A1 okay, but you've still got it connected to the Mouse Y, too. You need to disconnect one or the other from the actual axis and give the one you're not using a midrange value.

More like:

>> IF(( [ JS2.A2 < 88] OR [ JS2.A2 > 168 ]) AND JS2.B3 ) then
>> CMS.A1 = JS2.A2; // Set the mousewheel to the Y axis
>> CMS.A2 = 128; // Set the Y axis to center
>> ELSE
>> CMS.A1 = 128;
>> CMS.A2 = JS2.A2;
>> ENDIF

You need to get the Ministick Y axis off it's normal axis, pass it through the CMS, and then send the CMS axis to the Mouse Y axis. I'm using CMS.A2 in the above. The way it is now, you're probably getting scroll, but it's relatively slow and probably masked by the fact that your Y axis is still connected to the ministick.

You might have better luck setting the deadzone for the ministick out around 25% or whatever the 88/168 values come to and then change that original comparison at the top to:

>> IF( [ JS2.A2 != 128 ] AND JS2.B3 ) then

The reason is that the way you've got it when it does switch to the mouse wheel it's a long way off center already and it's going to be difficult to get slow speeds. Everytime you get close to the middle position, your scroll will shut down. If you use a wide deadzone, it will just start at 128 when you get there and go smoothly (assuming the ministick is okay) down to 0 or up to 255. You can still do the comparisons on the JS2.A2 axes in the script okay, the deadzone you want to set is actually on the CMS.A1 device.

>> CMS.B2 = [JS2.A1 < 88] and not (JS2.B3); // CURSOR LEFT
>> CMS.B3 = [JS2.A1 > 168] and not (JS2.B3); // CURSOR RIGHT
>> CMS.B4 = [JS2.A2 > 168] and not (JS2.B3); // CURSOR DOWN
>> CMS.B5 = [JS2.A2 < 88] and not (JS2.B3); // CURSOR UP

That looks fine, it should still work as far as I can tell.

>> Also... any way to emulate the middle mouse button?

Try Button 3. I can't really recall if it connects or not, and it would have to be application-supported if it is.

One note, I set that scroll wheel up earlier and it worked fine but I apparently shut down with the stick off-center and it left a little off-center scroll stuck in the mouse registers, the scroll drifted when I went back to Direct Mode. It was rather disconcerting as it kept scrolling the axis boxes in the GUI and I couldn't reset it to Z to clear the regs. It should be clearing when the mode goes back to direct, I'll have to look and see where it's gone astray. In any case, make sure the ministick is centered when you shut the map down so that it's not in the middle of sending a scroll report.

Let me know if that sorts things out.

- Bob

The StickWorks
http://www.stickworks.com

Wazoo
20-01-2004, 12:43 AM
Originally posted by Bob Church@Jan 12 2004, 07:33 AM


Let me know if that sorts things out.

- Bob


Hey Bob,

Just wanted to drop a note to thank you for your assistance.

I ended up doing a workaround in the sim to obviate the need for this as it just wasn't working for me.

However.... your efforts are GREATLY appreciated and I've utilized your wisdom since way back in the days of my Thrustmast FCS gear...

thanks again!

Wazoo :cheers: