View Full Version : Mini stick on USB thrott
Silat
21-02-2004, 10:39 AM
Can the ministick be programmed to operate as a "8" way hat for views??
Revvin
21-02-2004, 01:28 PM
I don't think it can be used as an 8 way hat (although there could be some funky CMS to do this) but it is easy to turn it into a 4 way hat switch without CMS, I showed a user how to do it in this (http://www.ch-hangar.com/forum/index.php?showtopic=20) thread.
Yes, it can, assuming that you can select your views using keys, such as the number keys on the keypad.
Here's one (although probably not the most efficient) way to do it:
%define msx js2.a1 // assuming that pro throttle is joystick 2
%define msy js2.a2
%define db 40 // deadband
%define up [msy < 128 - db]
%define down [msy > 128 + db]
%define left [msx < 128 - db]
%define right [msx > 128 + db]
%define up_key cms.b1
%define upright_key cms.b2
%define right_key cms.b3
%define downright_key cms.b4
%define down_key cms.b5
%define downleft_key cms.b6
%define left_key cms.b7
%define upleft_key cms.b8
// Test for up
if (up and not left and not right) then
up_key = TRUE;
else
up_key = FALSE;
endif
// Test for up and right
if (up and right) then
upright_key = TRUE;
else
upright_key = FALSE;
endif
// Test for right
if (right and not up and not down) then
right_key = TRUE;
else
right_key = FALSE;
endif
// Test for down and right
if (down and right) then
downright_key = TRUE;
else
downright_key = FALSE;
endif
// Test for down
if (down and not left and not right) then
down_key = TRUE;
else
down_key = FALSE;
endif
// Test for down and left
if (down and left) then
downleft_key = TRUE;
else
downleft_key = FALSE;
endif
// Test for left
if (left and not up and not down) then
left_key = TRUE;
else
left_key = FALSE;
endif
// Test for up and left
if (up and left) then
upleft_key = TRUE;
else
upleft_key = FALSE;
endif
To finish this off, set the cms.b1-b8 buttons in the GUI to the keypresses that generate the appropriate views (e.g., set cms.b1 to generate the key that produces the "up" view).
I haven't tested this, but it should work, absent any syntax errors. If what you want is to have the ministick generate the DirectX POV input, I'm not sure that will work. But you could try setting the cms.b1-b8 buttons to the DirectX button outputs that correspond to the POV positions. I think that they are 25-32, or something like that.
- JNOV
I just tested the script and it works as expected. The only thing is that appently you cannot nest definitions in CMS. So the script as listed, while logically correct, yields a compilation error. To fix it, just hardcode the axis (js2.a1 or js2.a2) and deadband value (40) in the up, down, left, and right definitions, as follows:
%define up [js2.a2 < 128 - 40]
%define down [js2.a2 > 128 + 40]
%define left [js2.a1 < 128 - 40]
%define right [js2.a1 > 128 + 40]
Hope that helps!
- JNOV
Richard
23-02-2004, 08:36 PM
Hi I'm new here. In reference to changing the mini-joystick to a 4 way hat switch ( REVVIN). Have you converted your mini joystick to a 4way button and use it to move the Target Designator box in the game Lock On. Does it work. I also assume you can change the 4 way button back to a mini joystick.
Revvin
23-02-2004, 11:44 PM
You could use different 'modes' to switch between the ministick being a 4 way hat switch or 8 way..thanks JNOV :) ) and then have the ministick act as a mouse in another mode. To move the HUD esignator you'd just follow the same example as I mentioned in my post above but use the corresponding designator movement keys ; ' . /
To enable modes open up a profile and under the 'Program Settings' tab select 'Mode Control' from the drop down list (see image below) once that is done then you will get three tabs appear for each button and axis on the stick and throttle to give you access to mapping each mode for each button/axis. By default selecting the joystick as mode control will make button 3 on the Fighterstick and button 5 on the combatstick switch between modes (LED's on joystick base will change colour) Selecting the Pro Throttle for mode control will make button 1 on the Pro Throttle change between modes and now the LED's wil lchange colour on the Pro Throttle base as you switch modes. You will also notice you can select CMS to control modes in that drop down list. Selecting CMS as the method of mode control means you gain an extra mode making 4 in total but when you use CMS the mode LED's on the joystick and throttle will not change as these LED's are hard wired.
Ack-ack
27-02-2004, 09:32 AM
Can you load a CMS script with a .map file or do you have to program all the functions in the script if you want to load a script?
Ack-Ack
Ack-Ack:
From your post on the HTC forum, I take it you've figured this one out. If not, drop me an e-mail and I'll be happy to help you.
The short answer is that you can use the CMS script to supplement the other programming that you've done in the GUI. That is, you need not implement your map functionality in a script. The thing to remember is that in order for the CMS outputs that you assign in a script (e.g., cms.b1 or cms.a4) to make it to the real world, you must assign the cms buttons and axes to do what you want in the GUI. You do this exactly as you would for actual, physical buttons or axes. The only difference is that you access the cms buttons and axes using the "CMS" tab in the GUI, rather than the tabs for your physical devices (e.g., Pro Throttle).
Hope this helps. Again, if this doesn't make sense or is confusing, drop me a line and I'll try to help!
- JNOV
vBulletin® v3.7.2, Copyright ©2000-2009, Jelsoft Enterprises Ltd.