3-position switch with DirectX
-
My ICP is wired through a USB device, with all buttons and switches functioning as DirectX inputs. All of the buttons were easy enough to program in the Controller UI, as were the two position rockers. My problem is with the center “NORM” position of the Drift C/O - WARN RESET switch. I can easily assign a DirectX value to the Drift C/O and WARN RESET positions using the UI, but when I try add the center switch position manually by adding the second line below to the key file, nothing happens when I return the switch to the center “NORM” position - the 3d HUD remains in the Drift C/O mode.
SimDriftCOOn 115 8 -2 0 0x0 -1
SimDriftCOOff 115 8 -2 0x42 0x0 -1Any thoughts?
-
First question that comes to mind: does the center position have an output or is it wired?
Send from my Xperia X using Tapatalk
-
Try this:
SimDriftCOOn 115 -2 -2 0 0x0 -1
SimDriftCOOff 115 -2 -2 0x42 0x0 -1
SimDriftCOOff 116 -2 -2 0x42 0x0 -1
SimWarnReset 116 -2 -2 0 0x0 -1look up the callbacks because I did not.
-
The center position is not wired and does not issue it’s own DirectX input/command. It is a typical ON-OFF-ON switch.
-
The center position is not wired and does not issue it’s own DirectX input/command. It is a typical ON-OFF-ON switch.
For C/O Drift then I think it is supposed to be ON-OFF-MOMENTARY?
Momentary for the horn reset -
For C/O Drift then I think it is supposed to be ON-OFF-MOMENTARY?
That is true. And actually, the down position of my switch is momentary.
-
Here is my RF switch’s DX entries.
SimRFNorm 141 -2 -2 0 0x0 0 "RF Switch - NORM" SimRFQuiet 141 -2 -2 0x42 0x0 0 "RF Switch - QUIET" SimRFQuiet 140 -2 -2 0x42 0x0 0 "RF Switch - QUIET" SimRFSilent 140 -2 -2 0 0x0 0 "RF Switch - SILENT"
this will work equally well for basically any of the three way switches in the viper, when wired ON-OFF-ON. It is pretty ideal for a momentary to center switch. This configuration assumes that in the upright position, windows sees DX button 142, in the center position, windows does not see any DX button, and in the lower position, windows sees DX button 141. It should be noted that as BMS counts DX numbers starting from zero, and the windows (and BMS setup window) count them starting from one, that there is a difference of one between the observed DX button number and the number you will need to use in the keyfile.
You can read quite a bit about it in the excellent series of manuals produced by Kolbe, and included in your install folder.
-
^ Do that. The 0x42 are “release context” events and you can set a 3-position switch using only 2 directx inputs.
-
^ Do that. The 0x42 are “release context” events and you can set a 3-position switch using only 2 directx inputs.
That’s my bit of learning today. Thanks chaps.
-
Actually the rl switch is ON-ON-ON(MOM).
I too had the same issue as my ICP switch was ON-OFF-ON(MOM) version connected on a Leo’s BU0836A controller, first I used a custom AutoHotKey script, it worked well but afterwards decided to move to custom DX commands to solve this.
-
Here is my RF switch’s DX entries.
SimRFNorm 141 -2 -2 0 0x0 0 "RF Switch - NORM" SimRFQuiet 141 -2 -2 0x42 0x0 0 "RF Switch - QUIET" SimRFQuiet 140 -2 -2 0x42 0x0 0 "RF Switch - QUIET" SimRFSilent 140 -2 -2 0 0x0 0 "RF Switch - SILENT"
I’ll try something similar to this when I get back in. I have read Kolbe’s BMS Key File Manual, but one thing though, I don’t fully understand the difference between -2 and 8, in the third field.
-
I confess, Im not entirely clear on the purpose of the ‘key down semantic’ either. I suspect if it was terribly important, Kolbe would have demonstrated an example and counter example, as he has done for other terms.
-
The Drift C/O switch is the main reason I added the 0x42 thing to the code in the first place – my ICPs are all DX button rigged and the MILSPEC switches are ON-OFF-(ON) so there’s no “push” button event for the bat returning to center. The first case was the DGFT switch and there’s a cfg file value for that…but I did that as a quick hack to solve a testing problem and then forgot about it for a while…when I did come back to the problem in general it didn’t seem like a good approach to extend that for each and every 3-way center-off switch in the cockpit and thus the 0x42 thing came into being. In fact I use that myself for DGFT now and it probably wouldn’t be hard to talk me out of removing the self-cancel thing from the config file since it’s kind of redundant now. Well, anyway, now you know how this sausage was made.
-
Thanks for the insight Mark and everyone. I did get this resolved by switching field three (Callback invocation behavior) from ‘8’ to ‘-2’. The entire code line appears as here;
SimDriftCOOff 115 -2 -2 0x42 0x0 -1 ```I manually added that line directly below the UI generated line;
SimDriftCOOn 115 8 -2 0 0x0 -1
-
The “8” is generated as soon as you assign a button via ui.
It is a glitch which is in most cases non-critical.Although:
It is a good advice not to assign DX functions via ui and save the key file.
Might work, might not, can screw up things.