Create callback/function
-
I would like to creat a trackIR pause callback/function, so I can assign it on my joystick.
In the BMS there are function for center and reload but no pause, and it is very useful also.
Anyone knows where to start?
The key editor is using callbacks from another file apparently which i cant locate.
It should be very easy as all I need is a function to press a button for pause.
Thanks.
-
Just add this line to your .key and then from in sim assign the key you have assign TIR to pause. Works and for DX logic = assign it to a joystick button.
SimDoNothing -1 0 0XFFFFFFFF 0 0 0 1 “TRACK-IR PAUSE”
-
There is no way you could “create” a callback by yourself as this needs to be coded.
The only way to get the TIR Pause function “into the sim” is to program one of your joystick buttons
with the key which invokes this function (F9 by default) or just hit F9 on the keyboard.The code line SimDoNothing -1 0 0XFFFFFFFF 0 0 0 1 “TRACK-IR PAUSE” will obviously fail as it is
assigned to a function which does exactly what it is supposed to: NothingThis is unrelated to any key file changes, be it DX or pure key assignments.
-
There is another way…using a AutoHotkey script and changing the F15 F16 key definition within TracKIR profile.
<key>126</key> for F15…Center
<key>127</key> for F16…Pause
What this script does is:
1. Shifted layer for a button short press: Center.
2. Shifted layer for a button long press: Pause.2Joy13:: ; y Joy x , y= controller ID number in windows, x= joy button number
KeyWait, 2Joy13 ; Wait for 2Joy13 to be released
x := A_TimeSinceThisHotkey ; Just assigning x here, for shorter “if’s”
GetKeystate, Button4status, 2Joy4
if (Button4status = “D”) { ; If 2Joy13 and 2Joy4 is pressed, centre or pause TrackIR
if (x < 500) ; If hotkey was held for less than 0.50 seconds, 500 ms
Send {F15} ; Send the key F15
else if (x > 500) ; If hotkey was held for more than 0.50 seconds, 500 ms
Send {F16} ; Send the key F16
return
}
return -
thank you all guys. I will try what Polaris proposed. It is similar to C++ which I know quite well.
-
Maybe off topic by a bit but, what and where is then center TIR callback? I find ReloadTrackIR -1 0 0XFFFFFFFF 0 0 0 1 “SIM: TrackIR Reload” but nothing to center. Using the Pitbuilder .key.
Thanks
Tulkas
-
Maybe off topic by a bit but, what and where is then center TIR callback? I find ReloadTrackIR -1 0 0XFFFFFFFF 0 0 0 1 “SIM: TrackIR Reload” but nothing to center. Using the Pitbuilder .key.
Thanks
Tulkas
RecenterTrackIR -1 0 0XFFFFFFFF 0 0 0 1 “SIM: TrackIR Recenter”
That is from the ‘Full’ key. If it’s not in the pitbuilder key, you can copy and paste it.