VJoy and AutoHotKey (AHK) Implementation
-
Hello Gents!
I’d like to share my findings on the successful use of vJoy (http://vjoystick.sourceforge.net) and AutoHotKey (https://autohotkey.com/) in cases where virtual DX Buttons have to replace real DX Buttons, in order to minimize the number of physical game controllers (like LeoBodnar’s BU0836X, BBI-32 and Pokeys57U, etc.) needed in a pit (see the attached picture “01.JoystickDevices.png”)
Of course, the current Falcon overall limit is the fact that it can recognize 16 Joystick IDs, in total of 512 DX buttons (which can be doubled using the “DX Shifting” method).
Personally, in my pit (see here) I use less physical controllers than all position of switches can produce to corresponding Falcon BMS available callbacks.
To understand the situation better, please see the attached picture “vJoy-AHK-Implementation_in_FalconBMS.png”.In Case 1, there is 1 physical DX button input for a situation where 2 callbacks in Falcon are available:
–> the PRESS (or ON) state for one callback
–> the Release (or OFF) state for another callback
An example of the TACT switch is the “MAL & IND LTS” push button in the TEST panel: Falcon BMS 4.33U3 has available one callback for the pressed state (SimMalIndLights) and one for the released state (SimMalIndLightsOFF)
An example of the ON-OFF switch is the “DIGITAL” switch in the FLIGHT CONTROL: Falcon BMS 4.33U3 has available one callback for the BACKUP position (SimDigitalBUPBackup) and one for the OFF position (SimDigitalBUPOff).
Of course, the above case can be solved using the “6.2.5 Fifth part: DX button press / release event” described in the “BMS Key File Manual.pdf” (page 22)In Case 2, there are 2 physical DX button inputs for a situation where 3 callbacks in Falcon are available:
–> the ON1 state for a first callback
–> the OFF state for a second callback
–> the ON1 state for a third callback
This situation can be solved in two ways (aside vJoy, and maybe PoKeys57U programming):
1st) The “6.2.5 Fifth part: DX button press / release event” method, following the described example: 9.2 HOW TO OVERCOME DX BUTTON SHORTCOMINGS?" (page 41)
2nd) With the aid of a 2-input NAND gate (see the quad package IC7404) to drive its output to a physical DX button input for the OFF switch position.In Case 3, there is an analog axis (a pot) without physical extra switch that closes (or opens) at the OFF position.
Examples of such needed (with a switch) are the COMM1, COMM2, ILS, ICP rotaries, etc.
Speaking of ILS knob, there are two available callbacks: SimILSOn and SimILSOff
In these knobs, the absence of a switch cannot be solved other way that using Vitrtual Buttons (vJOY and AHK):arrow: Find the following mentioned files HERE.
In the excel file, I’ve charted down:
- all possible switch positions in my pit
- all the “dependencies” of each switch positions
- all available falcon callbacks for my pit’s switches
Using various concatenations (I love this function ), the final results are two “automated” text files:
- A working “DX SECTOR” part of the keyfile for Falcon
- A working AHK script (HVP__REAL_JoyButtons_Trigger_vJoy_v.1.ahk) which solves all three cases (needs the library vJoy_lib.ahk)
Whoever is confused with AHK, I’d like to point out an EXCELLENT application which is the Universal Control Remapper (UCR) found here, written by evilC.
I personally thank evilC for his help, who was very willing to code the mostly needed plugin: “ButtonstoButton.ahk”.
I have his permission to post the code here, for anybody to use with UCR.Feel free to study the attached files, and enjoy!