DX Codes - Shifted Layer Issue
-
I am trying to assign DX codes to the shifted layer, but am having issues. Here is what I have done.
I set up the set the S3 pinky button as the shift button in the profile: SetShiftButton(&Joystick, S3);
I am running a Warthog stick as throttle and TM combined in BMS.
I then set up the callback, SimHotasPinkyShift, in both shifted and unshifted layer in the .key file - DX + 256 for the shifted
layer:SimHotasPinkyShift 2 -1 -2 0 0x0 0
SimHotasPinkyShift 258 -1 -2 0 0x0 0Do I need to define the shifted layer in the profile?: MapKey(&Joystick, S3, DX258, DX2); I didn’t think so because the other profiles that used the shifted state do not. It seemed to work without it.
I then created DX callbacks for the shifted and unshifted layers in the .key file.
Example:
SimTMSUp 6 8 -2 0 0x0 -1
SimRadarAGModeStep 262 -1 -2 0 0x0 0I defined the DX linked callbacks in the profile to insure that is bound to the button.
Example:
MapKeyIO(&Joystick, H2U, DX263, DX7);I run the script and keep on getting an error message. Is there something I missed? I took at look at the defines.tmh file and did not see DX256+ listed - only DX1-32. My guess is that TARGET is not recognizing the shifted DX code. If I replace DX263 with a keystroke then it works.
Anyone have any ideas?
Thanks!
-
Your BMS callbacks and description look fine. I have the Warthog stick, but it’s used without a Target profile. I’m sure Target must serve some good purpose, but I have no idea what.
-
Your BMS callbacks and description look fine. I have the Warthog stick, but it’s used without a Target profile. I’m sure Target must serve some good purpose, but I have no idea what.
How do you configure your profile? In BMS?
How does TARGET know about the shifted layer? Is there something I could define in the defines.tmh file? Doesn’t that come into play only via the key file in the sim? All the profiles that use the shifted layer do not define the shifted DX (+256) values in the profile. Only the key.
-
I put the commands in my keyfile. Nothing else. Like so (stick only here):
#====================DX LINES BEGIN HERE============================================= SimDoNothing -1 0 0XFFFFFFFF 0 0 0 -2 "========= WARTHOG STICK UNSHIFTED =========" SimTriggerFirstDetent 0 -1 -2 0 0x0 -1 SimPickle 1 -1 -2 0 0x0 -1 SimAPOverride 2 -1 -2 0 0x0 -1 SimHotasPinkyShift 3 -1 -2 0 0x0 -1 SimMissileStep 4 -1 -2 0 0x0 -1 SimTriggerSecondDetent 5 -1 -2 0 0x0 -1 SimTMSUp 6 -1 -2 0 0x0 -1 SimTMSRight 7 -1 -2 0 0x0 -1 SimTMSDown 8 -1 -2 0 0x0 -1 SimTMSLeft 9 -1 -2 0 0x0 -1 SimDMSUp 10 -1 -2 0 0x0 -1 SimDMSRight 11 -1 -2 0 0x0 -1 SimDMSDown 12 -1 -2 0 0x0 -1 SimDMSLeft 13 -1 -2 0 0x0 -1 SimCMSUp 14 -1 -2 0 0x0 -1 SimCMSRight 15 -1 -2 0 0x0 -1 SimCMSDown 16 -1 -2 0 0x0 -1 SimCMSLeft 17 -1 -2 0 0x0 -1 PrettyScreenShot 18 -1 -2 0 0x0 -1 AFElevatorTrimUp 0 -1 -3 0 0x0 -1 SimDoNothing 0 -1 -3 1 0x0 -1 AFAileronTrimRight 0 -1 -3 2 0x0 -1 SimDoNothing 0 -1 -3 3 0x0 -1 AFElevatorTrimDown 0 -1 -3 4 0x0 -1 SimDoNothing 0 -1 -3 5 0x0 -1 AFAileronTrimLeft 0 -1 -3 6 0x0 -1 SimDoNothing 0 -1 -3 7 0x0 -1 #================================================================================== SimDoNothing -1 0 0XFFFFFFFF 0 0 0 -2 "========= WARTHOG STICK SHIFTED =========" SimWheelBrakes 256 -1 -2 0 0x0 -1 SimEmergencyJettison 257 -1 -2 0 0x0 -1 AFResetTrim 258 -1 -2 0 0x0 -1 SimHotasPinkyShift 259 -1 -2 0 0x0 -1 SimCATSwitch 260 -1 -2 0 0x0 115 SimDoNothing 261 -1 -2 0 0x0 -1 SimSelectSRMOverride 262 -1 -2 0 0x0 -1 SimDeselectOverride 263 -1 -2 0 0x0 -1 SimSelectMRMOverride 264 -1 -2 0 0x0 -1 SimDeselectOverride 265 -1 -2 0 0x0 311 SimArmMasterArm 266 -1 -2 0 0x0 311 SimExtlMasterNorm 267 -1 -2 0 0x0 311 SimSafeMasterArm 268 -1 -2 0 0x0 115 SimExtlMasterOff 269 -1 -2 0 0x0 115 SimLaserArmOn 270 -1 -2 0 0x0 310 SimFuelDoorOpen 271 -1 -2 0 0x0 311 SimLaserArmOff 272 -1 -2 0 0x0 310 SimFuelDoorClose 273 -1 -2 0 0x0 311 SimAVTRToggle 274 -1 -2 0 0x0 -1 OTWViewUp 2 -1 -3 0 0x0 -1 SimDoNothing 2 -1 -3 1 0x0 -1 OTWViewRight 2 -1 -3 2 0x0 -1 SimDoNothing 2 -1 -3 3 0x0 -1 OTWViewDown 2 -1 -3 4 0x0 -1 SimDoNothing 2 -1 -3 5 0x0 -1 OTWViewLeft 2 -1 -3 6 0x0 -1 SimDoNothing 2 -1 -3 7 0x0 -1
…. How does TARGET know about the shifted layer? …
I don’t know. I have not yet discovered a purpose for Target; I don’t use it and have not installed it.
-
It doesnt know about the DX shifted layer.
-
It doesnt know about the DX shifted layer.
I was wondering about that. That’s why I asked the question. So do you define the shifted layer in BMS. By binding the shifted DX keys.
Sent from my iPhone using Tapatalk
-
They are bound using the keyfile. You use a text editor.
-
They are bound using the keyfile. You use a text editor.
I read through your BMS key file manual and have been editing key files with note pad. I was just curious if there is anything else that needs to be done because it seems (I maybe wrong about this or maybe there is an issue in my key file) that if I do not define the DX keys in TARGET that it does not work.
In JCs script, for example, TG1, TG2, S1, S2, S3, TMS, DMS, CMS, LTB, Coolie, the speed brake, and mic switch are mostly or entirely controlled by the key file. How does Warthog, or more accurately Windows, know that a particular DX code and callback (SimRadarAGModeStep 262 -1 -2 0 0x0 0) in the key file is assigned to the shifted H2U button if it is not mentioned in the TARGET script or bound in BMS? Is there some kind of default DX number a the programming level that is tied to a particular button? I thought lines preceded by a “#” was only a description, “#DMS” for example, that had not impact on the programming of the script?
Thanks for your help!
-
I can’t speak to the Warthog throttle specifically, but this is true for the Warthog stick and every other HOTAS device I’ve used (T-Flight, X52, X52 Pro):
When you connect the device, Windows, and BMS, recognize, without 3rd party software intervention, up to 32 buttons/switches on that device. Those 32 buttons/switches can be accessed directly by BMS with a BMS callback assigned to their native button/switch number.
Then the DX shift state functionality can be applied and it is directly recognized by BMS.
BMS ‘knows’ by button number. Those number are assigned as shown here in the header here: https://www.benchmarksims.org/forum/showthread.php?23661-Flounder-s-X52-Pro-Keyfile-DX-Profile-for-BMS-4-33&p=345909&viewfull=1#post345909
As long as the device order remains the same, the callbacks will be on the button/switch you’ve assigned them to. There is a file in BMS 4.33.1 to facilitate constant device order.
-
I read through your BMS key file manual and have been editing key files with note pad. I was just curious if there is anything else that needs to be done because it seems (I maybe wrong about this or maybe there is an issue in my key file) that if I do not define the DX keys in TARGET that it does not work.
In JCs script, for example, TG1, TG2, S1, S2, S3, TMS, DMS, CMS, LTB, Coolie, the speed brake, and mic switch are mostly or entirely controlled by the key file. How does Warthog, or more accurately Windows, know that a particular DX code and callback (SimRadarAGModeStep 262 -1 -2 0 0x0 0) in the key file is assigned to the shifted H2U button if it is not mentioned in the TARGET script or bound in BMS? Is there some kind of default DX number a the programming level that is tied to a particular button? I thought lines preceded by a “#” was only a description, “#DMS” for example, that had not impact on the programming of the script?
Thanks for your help!
Happy to help. I have not actually produced a BMS key file manual, although its possible Im hosting a copy of one produced by Kolbe or another of the excellent folks who work to make our simming lives easier.
If you are using TARGET, then there is a limit to how much I can help with that. I dont have TARGET, and I dont have a warthog. Using Foxy, the equivalent of TARGET for the Cougar, it is possible to assign DX button numbers to specific controls on the Cougar, programmatically. I assume the same is possible with TARGET.
Without TARGET, or Foxy, and for pretty much all joysticks, DirectInput recognises them and has some assumptions about their input. A specific button will always be a specific DX number. The trigger of a joystick is generally the first button, for instance. All joysticks of a specific model will have the same button order (unless its a cougar with a Foxy script that changes them around, for example).
The keyfile for BMS is capable of assigning a specific callback to a specific DX button press or release, or to a specific keyboard control press or release. It has no way whatsoever, of matching a specific callback to a specific button on your joystick. Of course, for most joysticks, it is a safe assumption that the DX button order never changes, so you can learn the button order, and use it in your keyfile. Or if you dont need to use shifted buttons, you can just use the UI. Click a callback, press the button you want to assign to that callback.
The warthog never knows about the connection between a specific callback and a specific DX button. Using TARGET, you can configure which DX button goes to which physical button, and using the BMS keyfile, you can configure which callback gets sent when which DX button is depressed. For most joysticks, you cannot configure the DX buttons, but seeing as they dont change, you dont need to - you just set the keyfile to match the DX buttons for the physical controls you want.
Hope that clears things up a little?
-
I can’t speak to the Warthog throttle specifically, but this is true for the Warthog stick and every other HOTAS device I’ve used (T-Flight, X52, X52 Pro):
When you connect the device, Windows, and BMS, recognize, without 3rd party software intervention, up to 32 buttons/switches on that device. Those 32 buttons/switches can be accessed directly by BMS with a BMS callback assigned to their native button/switch number.
Then the DX shift state functionality can be applied and it is directly recognized by BMS.
BMS ‘knows’ by button number. Those number are assigned as shown here in the header here: https://www.benchmarksims.org/forum/showthread.php?23661-Flounder-s-X52-Pro-Keyfile-DX-Profile-for-BMS-4-33&p=345909&viewfull=1#post345909
As long as the device order remains the same, the callbacks will be on the button/switch you’ve assigned them to. There is a file in BMS 4.33.1 to facilitate constant device order.
Agave_Blue,
Thank you again for your information. I have spent countless hours trying to configure my Warthog HOTAS - more than I have spent in the sim. A month or so ago the whole scripting thing was like a foreign language. Accessing the resources on this site as well as getting feedback from more experienced users like you has helped me understand enough to make some headway. I have been using the key file as much as possible to assign DX numbers to the buttons. I am running the throttle and stick as TM combined. The stick seems pretty stable - there is a match between the DX number and the button - both shifted and unshifted. Once I get to the throttle I am unable to determine which DX number goes with which button. If I press boat switch forward I get button 4, for example.But as long as I can use the key file to configure the buttons on the stick then that should be all I need.
Thanks again!
-
Happy to help. I have not actually produced a BMS key file manual, although its possible Im hosting a copy of one produced by Kolbe or another of the excellent folks who work to make our simming lives easier.
If you are using TARGET, then there is a limit to how much I can help with that. I dont have TARGET, and I dont have a warthog. Using Foxy, the equivalent of TARGET for the Cougar, it is possible to assign DX button numbers to specific controls on the Cougar, programmatically. I assume the same is possible with TARGET.
Without TARGET, or Foxy, and for pretty much all joysticks, DirectInput recognises them and has some assumptions about their input. A specific button will always be a specific DX number. The trigger of a joystick is generally the first button, for instance. All joysticks of a specific model will have the same button order (unless its a cougar with a Foxy script that changes them around, for example).
The keyfile for BMS is capable of assigning a specific callback to a specific DX button press or release, or to a specific keyboard control press or release. It has no way whatsoever, of matching a specific callback to a specific button on your joystick. Of course, for most joysticks, it is a safe assumption that the DX button order never changes, so you can learn the button order, and use it in your keyfile. Or if you dont need to use shifted buttons, you can just use the UI. Click a callback, press the button you want to assign to that callback.
The warthog never knows about the connection between a specific callback and a specific DX button. Using TARGET, you can configure which DX button goes to which physical button, and using the BMS keyfile, you can configure which callback gets sent when which DX button is depressed. For most joysticks, you cannot configure the DX buttons, but seeing as they dont change, you dont need to - you just set the keyfile to match the DX buttons for the physical controls you want.
Hope that clears things up a little?
The last stick I had was the TM F-22 stick. Maybe I am remembering incorrectly but it seems to have been much easier to configure. The background you gave helped a lot - giving me some parameters for what I was doing. I find it interesting that the a particular DX number is not hard coded to a particular button. Scripting seems more like an art than pure technology.
-
Well, for most sticks it is hard coded to a particular button, essentially. TM gear is especially configurable, though. Note that I am making assumptions for TARGET - as above, I do not have it.
-
B2Blain, have you tried using the Excel .key file editor found on the docs folder of th BMS install?
This is what I use all the time to map all of my buttons. I have the Saitek X52 and I do not use the software that came with the stick. I use the Excel editor to map all the buttons using DX.
On August 20th Saturday, my new Warthog Trustmaster will arrive. I intend to use the same .key file for two reasons, first I use a touch screen with the Helios software (I’ll tell you about that later) second because I don’t want to change my keyboard shortcuts. I already looked at the file and the Warthog set up seems prety stright forward. I can see I will be able to use shifted key conbinations practically doubling the amount of key available on the HOTAS.
As I understand, most people abandon the softaware that comes with their sticks and prefer to use DX assigment instead because the software tends to have unintended consequenses and the additional software needed to translate the callbacks to BMS.
With DX assigments is only Windows and BMS talking to each other.
I’ll let you know how it goes.
Pika