Contents

Previous

Next

Last

Scripting with the Trackball

The trackball is referenced in a CMS script just like a stick. It's JS1.A1 through JS1.A4 and JS1.B1 through JS1.B4 (if it's the leftmost tab next to the Program Settings tab). JS1.A3 and JS1.A4 are pseudo-axes that are only available via CMS. They provide the relative movement values from the trackball. If you reference JS1.A1 and JS1.A2, you're asking for the joystick values. When you assign the trackball in a CMS script, it can't tell which axes you want to use, the double set of axes lets you tell it.

The axes are set up to pass through the CMS without having to modify the values. If you do something like:

CMS.A1 = JS1.A3;
CMS.A2 = JS1.A4;

and then in the GUI you assign CMS.A1 and CMS.A2 to the Mouse X and Mouse Y axes, it will work just as if you'd assigned the trackball directly to Mouse X and Mouse Y in the GUI.

The values for the trackball are set up similarly to all other axes insofar as their CMS usage goes. In particular, a value of 128 is seen as "center" and so causes no movement of the mouse cursor. Values below 128 go left and up, values above 128 go right and down. The maximum value is 255.

Using CMS, you might want to use either of these types of data when referring to the Trackball. It would depend on whether you ultimately would be sending it to a CM Device or to the mouse proxy. CMS makes allowance for this by actually recognizing 4 axes. The A1 and A2 axes act like a joystick X and Y. The A3 and A4 axes return the movement data like a mouse. You can refer to either set of values (or both sets if you can think of a reason to do it). Normally, you would use A1 and A2 if you were sending the data to a CM Device, A3 and A4 if it's going to the mouse proxy. If you assign the Trackball axes directly in the GUI, the Control Manager selects the movement or position data based on what you assign them to (CM Device or Mouse).

When you send data into a CMS control which ultimately sends it to the mouse proxy, there's a bit of a problem. The CMS has to handle things differently depending on whether the data is relative (like mouse data) or positional (like joystick data). Unfortunately, the CMS can't figure this out for itself because it can't know where the data came from or where it's going.

Consequently, there are three flags that need to be set or cleared (perhaps dynamically) if you're generating mouse data in the CMS. There will be specially named flags in the CM3 Final, but for now the B1022 (Z), B1023 (Y), and B1024 (X) flags are being used. You need to set them TRUE if you are feeding relative data to a mouse through the CMS Controls. If you're feeding Joystick data, then the flags should be set FALSE. That's their default state anyway, so if you don't have a Trackball in the map that you have to flag as sending relative data, you can just ignore B1022..B1024. Your current maps should still run fine.