PDA

View Full Version : mini stick as a 4 way hat?



madrebel
5th July 2004, 03:49 AM
is there anyway to do this? i would like to turn my mini stick into a 4 way hat but im really new to this whole programming the stick thing.

let me clarify ... i would like each direction to send a key press. like a banded axis type thing.


*edit*

okay i found this in another post


CMS.B1 = [JS2.A1 > 220];
CMS.B2 = [JS2.A1 < 30];
CMS.B3 = [JS2.A2 > 220];
CMS.B4 = [JS2.A2 < 30};
[/b]

but when i paste that into the CM editor and hit the check script key it gives me the error


ERROR: (265) compareOp: aExpr _LT $$26 aExpr _(79) at "."
[/b]

:thumbsdown:

any ideas?

MichaelCHProd
5th July 2004, 04:57 AM
There is a typo...


CMS.B1 = [JS2.A1 > 220];
CMS.B2 = [JS2.A1 < 30];
CMS.B3 = [JS2.A2 > 220];
CMS.B4 = [JS2.A2 < 30};[/b]

should read..

CMS.B1 = [JS2.A1 > 220];
CMS.B2 = [JS2.A1 < 30];
CMS.B3 = [JS2.A2 > 220];
CMS.B4 = [JS2.A2 < 30];[/b]

madrebel
5th July 2004, 09:03 AM
ok ... hmm now it seems that i dont know what to do from here lol. this scripting thing isnt as easy as i had hoped.

oh well ill figure it out.

ok im kinda confused now. what is a CMC file and what is a CMS file? it seems the CMS file is for the scripts but what is the purpose of the CMC file?

*edit* also how do i use the mode functions?

MichaelCHProd
6th July 2004, 04:42 AM
On the Control Manager tool bar..
ftp://ftp.chproducts.com/pub/Postings/CM_Toolbar.jpg

Go to the eighth icon from the left, the CMS Editor..ftp://ftp.chproducts.com/pub/Postings/CM_CMS-Editor.jpg

When the CMS Editor opens up it will look like this..
ftp://ftp.chproducts.com/pub/Postings/CM_CMS-Editor-Screen.jpg

Paste this...


CMS.B1 = [JS2.A1 > 220];
CMS.B2 = [JS2.A1 < 30];
CMS.B3 = [JS2.A2 > 220];
CMS.B4 = [JS2.A2 < 30];
[/b]
Into the script between

madrebel
7th July 2004, 12:18 AM
yeah i got that part.

ok help me with this. the cms file goes hand in hand with the &#39;.map&#39; file yes? meaning, when i create a .map file it also creates a .cms file. anything i put in that cms file corresponds with the .map file too?

if the above is true what is the .cmc file for then?

Cali
24th November 2004, 05:17 AM
Bump this up

ruggbutt
24th November 2004, 05:27 AM
The .cmc file is a complete list of commands w/the keypresses. When you are mapping your joystick, you can choose the insert command function instead of the keypress, then commenting what it does underneath in the bottom box. It saves you time when mapping the stick.

JNOV
25th November 2004, 01:19 AM
Originally posted by madrebel@Jul 6 2004, 11:18 PM
yeah i got that part.

ok help me with this. the cms file goes hand in hand with the &#39;.map&#39; file yes? meaning, when i create a .map file it also creates a .cms file. anything i put in that cms file corresponds with the .map file too?

if the above is true what is the .cmc file for then?
<div align="right">4925
[/quote]
Yes, that&#39;s right, madrebel. You can think of the cms buttons (e.g., cms.b1, cms.b2, cms.b3, and cms.b4 in your script) as virtual buttons. What your script has done is define under what conditions those virtual buttons are pressed. That is, when you move the ministick sufficiently to the right, cms.b1 is "pressed." When you move it sufficiently to the left, cms.b2 is "pressed." When you move it sufficiently down, cms.b3 is "pressed." And, when you move it sufficiently up, cms.b4 is "pressed."

So far, so good, but that&#39;s just the first step. What you must do now is go under the CMS Controls tab in control manager and assign keypresses to your cms buttons. Select a cms button (e.g., cms.b1) by clicking on the corresponding bubbles in the left-hand portion of the CMS Controls GUI. (CMS.B1 is the upper-left-most bubble, and the buttons are numbered left-to-right, top-to-bottom from there.) Once you&#39;ve selected a button that you&#39;ve assigned in your script (i.e., cms.b1, cms.b2, cms.b3, or cms.b4), assign a keypress or key sequence in the right-hand portion of the CMS Controls GUI, just as you would for a "physical" HOTAS button, such as the Fighterstick trigger. For example, if you want moving the ministick to the right to simulate pressing and holding the right arrow keyboard key, you&#39;d select button CMS.B1 and type "KBRIGHT" in the "Normal Action"/"Press" edit box. (Alternatively, you can right click in the edit box, select "Record Keystrokes" and just press the key(s) you want to send.)

I hope that helps. If it&#39;s still not clear, please respond and I&#39;m sure that I or someone else will get you squared away.

Best regards,

JNOV

ruggbutt
25th November 2004, 02:21 AM
Is the throttle joystick supposed to be mapped to CM Device 1 and then assigned axis?

JNOV
25th November 2004, 03:35 AM
Originally posted by ruggbutt@Nov 25 2004, 01:21 AM
Is the throttle joystick supposed to be mapped to CM Device 1 and then assigned axis?
<div align="right">8519
[/quote]
You can do that, if you want to use it as an axis. For example, you could assign it to Device 1, R axis for use as a rudder control if you don&#39;t have pedals. Or you might assign its axes to the DirectX mouse X and Y axes for to use it as a mouse control. Or you might assign it to Device 2 X and Y axes to control the radar cursor in a jet sim like Falcon 4. I&#39;ve used it to emulate dual-throttle control for some sims that support it. The possibilities really are limitless.

But what madrebel wanted to know about, I think, was programming the ministick for use as a four-way hat. To accomplish that, you could use a script like the one he proposes and assign keypresses in the CMS Controls tab of the Control Manager GUI as I described above.

Best regards,

JNOV

ruggbutt
25th November 2004, 08:55 AM
Roger, got it figured out. I&#39;d have posted about my success but I couldn&#39;t stand it, I had to fire up LOMAC and blow some stuff up.

Ironstripes
26th November 2004, 07:01 PM
Ok, I had my mini set up as a 4 way hat switch for few months now, someone help me set it up and didn&#39;t have to do he scripting we just assigned keys but there was a special way to do it, well I lost my map I saved after we got it working right, could any tell me how to just assign striaght keystrokes to the mini joy to get 4 way production out of it, just wanna move around in FPS with it. Thank You

JNOV
27th November 2004, 03:02 AM
Originally posted by Ironstripes@Nov 26 2004, 06:01 PM
Ok, I had my mini set up as a 4 way hat switch for few months now, someone help me set it up and didn&#39;t have to do he scripting we just assigned keys but there was a special way to do it, well I lost my map I saved after we got it working right, could any tell me how to just assign striaght keystrokes to the mini joy to get 4 way production out of it, just wanna move around in FPS with it. Thank You
<div align="right">8584
[/quote]
You can do what you want by deselecting the DirectX checkbox in the Control Manager GUI for the ministick X and Y axes and selecing the position radio button. Then you can type

KBLEFT NULL KBRIGHT

and

KBUP NULL KBDOWN

in the position keys edit boxes for the X and Y axes, respectively. I prefer to use scripting because it gives more control, but something like what I&#39;ve typed above is a quick fix if you don&#39;t want to mess with scripting.

Best regards,

JNOV

MichaelCHProd
27th November 2004, 03:10 AM
Already bagged him in another THREAD (http://www.ch-hangar.com/forum/index.php?showtopic=1298) JNOV :)

Cali
3rd December 2004, 04:28 AM
I just tried to add that into the cms script, well it works. But it didn&#39;t work like a regular hat, it keep centering. I turned center off in the ch managar? It is set as Y and X axis and DirectX mode is checked. oops never mind :censored: I didnt&#39;t uncenter it from every mode.

Cali
3rd December 2004, 04:39 AM
OK IT DIDNT WORK

ruggbutt
3rd December 2004, 06:08 AM
Here ya go Cali.
http://members.cox.net/ruggbutt/01.jpg
http://members.cox.net/ruggbutt/02.jpg
http://members.cox.net/ruggbutt/03.jpg
http://members.cox.net/ruggbutt/04.jpg
http://members.cox.net/ruggbutt/05.jpg

Cali
13th December 2004, 09:07 AM
Thanks RuGG just saw it, I&#39;ll mess around with it tomarrow it&#39;s getting late here. :thumbsup: :cheers:

Cali
14th December 2004, 02:58 AM
OK RuGG I did that and it still didn&#39;t work.