Jump to content

Thrustmaster Combined Full DX Mapping (extending the 32 DX buttons limit)


Recommended Posts

PM Sedenion, it's easier to have a private discussion with the author than us. But, I use it exclusively for all modules in DCS, And its very easy to use. Sedenion will PM you back, he is happy to help where he can. 

Cheers

 

Sempre Fortis

Link to comment
Share on other sites

  • 2 months later...

Hello. I was wondering. When running this (intended only to use with my throttle) my buttons get all disorganized like rebinding the pov 8 way on the back of the throttle to different keys and the original slew axis changes to another of axis. Is there a way to keep the original set of commands but add the extra dx keys?

Link to comment
Share on other sites

Sedenion's script turns every button into a DX button by default (see chart_complete.png).
Either you need to rewrite MapThrottle.tmh to match it to your current setup or get the DX120 mod and integrate that into your script so you have the 120 DX buttons available for your own profiles and use them where you want them.

Win11 Pro 64-bit, Ryzen 5800X3D, Corsair H115i, Gigabyte X570S UD, EVGA 3080Ti XC3 Ultra 12GB, 64 GB DDR4 G.Skill 3600. Monitors: LG 27GL850-B27 2560x1440 + Samsung SyncMaster 2443 1920x1200, HOTAS: Warthog with Virpil WarBRD base, MFG Crosswind combat pedals, TrackIR4, Rift-S.

Personal Wish List: A6 Intruder, Vietnam theater, decent ATC module, better VR performance!

Link to comment
Share on other sites

  • 1 month later...
9 hours ago, Nahemoth said:

Is it possible to use this script while I assign a specific keyboard keypress to a button? 

Or assign a keyboard key to one of the of the buttons of the created virtual device.

You can edit the script replacing a DX assignment by keyboard stroke, but this is counter usage of the script. Why do you want/need a key stroke instead of a button ?

  • Like 1
Link to comment
Share on other sites

hace 5 minutos, sedenion dijo:

You can edit the script replacing a DX assignment by keyboard stroke, but this is counter usage of the script. Why do you want/need a key stroke instead of a button ?

I want to use the Scratchpad mod that uses a specific keyboard stroke to enable it (by default CTRL+SHIFT+X), and it would be nice to activate from the HOTAS.

I tried what you suggest but it didn't work, I will try again.

Thanks

Link to comment
Share on other sites

2 minutes ago, Nahemoth said:

I tried what you suggest but it didn't work, I will try again.

What did you tried exactly ? I suspect you changed the wrong thing... If you want to substitute DX with key stroke on a specific physical button, you must modify the proper Mapping function call withtin the proper mapping file header:

  • MapThrottle.tmh for Warthog Throttle
  • MapJoystick.tmh for Warthog Joystick
  • MapJoystickF18.tmh for Warthog F18 Stick
  • etc.
Link to comment
Share on other sites

hace 2 minutos, sedenion dijo:

What did you tried exactly ? I suspect you changed the wrong thing... If you want to substitute DX with key stroke on a specific physical button, you must modify the proper Mapping function call withtin the proper mapping file header:

  • MapThrottle.tmh for Warthog Throttle
  • MapJoystick.tmh for Warthog Joystick
  • MapJoystickF18.tmh for Warthog F18 Stick
  • etc.

I did the following change in MapJoystick.tmh, replacing

  if(LONG_S3) { MapKey( &Dev,    S3,     TEMPO(DX3, DX73, TEMPO_TIME)); }
  else        { MapKey( &Dev,    S3,     DX3); }

by

 MapKey( &Dev,    S3,     <keystroke>);

 

Link to comment
Share on other sites

14 minutes ago, Nahemoth said:

I did the following change in MapJoystick.tmh, replacing

  if(LONG_S3) { MapKey( &Dev,    S3,     TEMPO(DX3, DX73, TEMPO_TIME)); }
  else        { MapKey( &Dev,    S3,     DX3); }

by

 MapKey( &Dev,    S3,     <keystroke>);

This should work... problem may come from the keystroke syntax or keystroke modifier key.

  // if(LONG_S3) { MapKey( &Dev,    S3,     TEMPO(DX3, DX73, TEMPO_TIME)); } //< comment this
  // else        { MapKey( &Dev,    S3,     DX3); }                          //< and this

  MapKey( &Dev,    S3,    R_CTL + R_SHIFT + 'x' );

or

  // if(LONG_S3) { MapKey( &Dev,    S3,     TEMPO(DX3, DX73, TEMPO_TIME)); } //< comment this
  // else        { MapKey( &Dev,    S3,     DX3); }                          //< and this

  MapKey( &Dev,    S3,    L_CTL + L_SHIFT + 'x' );

To be honest, I almost never used keystroke syntax in TARGET advanced script, so I would not be a best help instantly 😄

If you have troubles, open a new topic with this specific question...


Edited by sedenion
Link to comment
Share on other sites

hace 6 horas, sedenion dijo:

This should work... problem may come from the keystroke syntax or keystroke modifier key.

  // if(LONG_S3) { MapKey( &Dev,    S3,     TEMPO(DX3, DX73, TEMPO_TIME)); } //< comment this
  // else        { MapKey( &Dev,    S3,     DX3); }                          //< and this

  MapKey( &Dev,    S3,    R_CTL + R_SHIFT + 'x' );

or

  // if(LONG_S3) { MapKey( &Dev,    S3,     TEMPO(DX3, DX73, TEMPO_TIME)); } //< comment this
  // else        { MapKey( &Dev,    S3,     DX3); }                          //< and this

  MapKey( &Dev,    S3,    L_CTL + L_SHIFT + 'x' );

To be honest, I almost never used keystroke syntax in TARGET advanced script, so I would not be a best help instantly 😄

If you have troubles, open a new topic with this specific question...

 

I managed to run it, it was related to the initialization:

  if(InitMoreDX(DX_COUNT, &EventHandle, CREATE_JOYSTICK+CREATE_KEYBOARD)) 

Just create the keyboard, which was missing (because your original script does not need it).

  • Like 1
Link to comment
Share on other sites

Hi,

New version of Combined Full DX Mapping Script moving to version 1.7.

The main change in this version is the addition of Digital Axis mapping for Throttle microstick (SC) and slider (Friction Control) axes. To be simple, the microstick now also act as 4-way hat, pressing DX button for each axis direction. Same thing for the slider, which can now be used as 2-position switch with a inactive middle position (I was sick of this unused FC slider, it can now be used as Landing Gear lever).

As usual, each Digital Axis mapping can be disabled or enabled within the main script entry file, bey setting the proper macro-define to 1 or 0. Also notice that Digital Axis mapping does not disable axes... they still usables as axes, they simply also emits buttons input.

This release also include the small modification done with the "hotfix" version 1.61, which modify the advanced AP Module to emit buttons inputs in well defined temporal sequence with a small amount of delay between each input change, in order to make them properly catched by DCS which. Indeed, since some updates, DCS did not properly catch simultaneous (or too closes) inputs. Maybe this is a feature, even if I don't well understand the purpose.

Download Link in the initial topic

  • Like 1
Link to comment
Share on other sites

  • 1 month later...

Sedenion, could you please help me out with this simple edit:

I would like to remove Shifting (or 'Layer' in TARGET terms) control from S3 but leave it's short/long switching of DX3/DX73 intact. This is important for F4 BMS as an example, because the BMS supports shifting with its own code. Other than this your script makes my TMW (F16 grip) ultimately universal joystick that can make any new bindings for any game/sim very fast. If it's possible please post the line which should be modified, hopefully it' won't require much of your coding time.

Thank you so much for sharing your terrific work.

Cheers,

Sabre.

 

PS: when I create a new association of a *.tmc file with an *.exe to some reason TARGET's app doesn't launch it. Is there a line I should add manually to the *.tmc? Thanks! 


Edited by Sabre
Link to comment
Share on other sites

13 minutes ago, Sabre said:

Sedenion, could you please help me out with this simple edit:

I would like to remove Shifting (or 'Layer' in TARGET terms) control from S3 but leave it's short/long switching of DX3/DX73 intact. This is important for F4 BMS as an example, because the BMS supports shifting with its own code. Other than this your script makes my TMW (F16 grip) ultimately universal joystick that can make any new bindings for any game/sim very fast. If it's possible please post the line which should be modified, hopefully it' won't require much of your coding time.

Thank you so much for sharing your terrific work.

Cheers,

Sabre.

 

PS: when I create a new association of a *.tmc file with an *.exe to some reason TARGET's app doesn't launch it. Is there a line I should add manually to the *.tmc? Thanks! 

 

Your wonderful code offers full convenience. This line:

define IO_ENABLE        1         //< Enable (1) or Disable (0) IO Shift for H1

Can I have this *.tmc launch my *.exe yet?

Link to comment
Share on other sites

1 hour ago, Sabre said:

Can I have this *.tmc launch my *.exe yet?

Theoretically, but it seem this indeed does not launch the exe file. I have no clue why.

1 hour ago, Sabre said:

Which file in the set controls custom axes' shapes and deadzones for my TMW.

In the same tmc file line 105 and 106 :

int CS_JOYX[5]      = { 0,  0,  0,  0,  0 };  //< Joystick JOYX
int CS_JOYY[5]      = { 0,  0,  0,  0,  0 };  //< Joystick JOYY

The three first values are the dead zones values, respectively the upper (or right), center and lower (or left). The fourth value is the curve factor, and the last value is the zoom (or crop/saturation)  value. All values are in % (range 0-100).

  • Like 1
Link to comment
Share on other sites

On 9/14/2022 at 4:12 PM, sedenion said:

 

In the same tmc file line 105 and 106 :

int CS_JOYX[5]      = { 0,  0,  0,  0,  0 };  //< Joystick JOYX
int CS_JOYY[5]      = { 0,  0,  0,  0,  0 };  //< Joystick JOYY

The three first values are the dead zones values, respectively the upper (or right), center and lower (or left). The fourth value is the curve factor, and the last value is the zoom (or crop/saturation)  value. All values are in % (range 0-100).

Sedenion, I would also like to be able to adjust dead zones for the slider and slew x/y controls on the Warthog's throttle to dumb them down and make less sensitive in analogue mode.

Much thanks!

Sabre.

Link to comment
Share on other sites

13 hours ago, Sabre said:

Sedenion, I would also like to be able to adjust dead zones for the slider and slew x/y controls on the Warthog's throttle to dumb them down and make less sensitive in analogue mode.

This is in the dame file bellow the JOYX and JOYY axes lines... however for FC slider, this is a "J" curve, you can't add dead zones. If you want an S curve to add dead zone on this axis, you have to edit the MapThrottle.tmh file (at line 167) to modify the THR_FC axis curve function call with desired parameters.

Example:

// Disable the original function call by adding // at begining of line
// SetJCurve(&Dev,   THR_FC,     CJ_THR_FC[0],     CJ_THR_FC[1]); 

// Add new SetSCurve() call for THR_FC with desired parameters
SetSCurve(&Dev,   THR_FC,     5, 0, 5,  0, 0);
  • Like 1
Link to comment
Share on other sites

  • 3 weeks later...
On 9/17/2022 at 8:23 AM, sedenion said:

This is in the dame file bellow the JOYX and JOYY axes lines... however for FC slider, this is a "J" curve, you can't add dead zones. If you want an S curve to add dead zone on this axis, you have to edit the MapThrottle.tmh file (at line 167) to modify the THR_FC axis curve function call with desired parameters.

Example:

// Disable the original function call by adding // at begining of line
// SetJCurve(&Dev,   THR_FC,     CJ_THR_FC[0],     CJ_THR_FC[1]); 

// Add new SetSCurve() call for THR_FC with desired parameters
SetSCurve(&Dev,   THR_FC,     5, 0, 5,  0, 0);

Hello sedenion! I decided to add TFRP T.Flight Rudder Pedals. So I've edited 0 to 1 in front of the relevant line in RunComplete.tmc. Now I'd like to apply a dead zone and modify the curve. How can I do that? I guess I'll need to add some line to tmc? 

Thank you. 


Edited by Sabre
Link to comment
Share on other sites

19 hours ago, Sabre said:

Hello sedenion! I decided to add TFRP T.Flight Rudder Pedals. So I've edited 0 to 1 in front of the relevant line in RunComplete.tmc. Now I'd like to apply a dead zone and modify the curve. How can I do that? I guess I'll need to add some line to tmc? 

Thank you. 

 

After modifying RunComplete.tmc as per above F4BMS sees throttle and rudder as the same axis to some reason. Is there a way to circumvent that within Target?

Thanks.


Edited by Sabre
Link to comment
Share on other sites

 

14 hours ago, Sabre said:

Hello sedenion! I decided to add TFRP T.Flight Rudder Pedals. So I've edited 0 to 1 in front of the relevant line in RunComplete.tmc. Now I'd like to apply a dead zone and modify the curve. How can I do that? I guess I'll need to add some line to tmc?

 

Like other axes, you have to add axis mapping curves functions calls using proper parameters. Since this is the TFRP T.Flight Rudder Pedals you can edit the MapTFRPRudder.tmh file and write the proper function call, either or J curve or S curve depending your needs, for example:

  // store device alias
  alias Dev = &TFRPRudder;
  
  // buttons and axes mapping here
  SetSCurve(&Dev,   TRPRIGHT,     5, 0, 5,  0, 0);
  SetSCurve(&Dev,   TRPLEFT,      5, 0, 5,  0, 0);
  SetSCurve(&Dev,   TRUDDER,      5, 0, 5,  0, 0);

 

14 hours ago, Sabre said:

After modifying RunComplete.tmc as per above F4BMS sees throttle and rudder as the same axis to some reason. Is there a way to circumvent that withing Target?

If you include new hardware device to be "mapped" by script, you have to modify the axes assignations for the virtual device. The axes assignation (hardware device axis -> virtual device axis) is done using the MapAxis() function. You'll see call to this function at bottom of each relevant mapping script file. For exemple, here is how Warthog Throttle axes are mapped (MapThrottle.tmh):

  // -- Axes Assignment --------------------------------------------------------
  MapAxis(  &Dev,   THR_LEFT,   DX_ZROT_AXIS,     1,   MAP_ABSOLUTE);
  MapAxis(  &Dev,   THR_RIGHT,  DX_Z_AXIS,        1,   MAP_ABSOLUTE);
  MapAxis(  &Dev,   THR_FC,     DX_SLIDER_AXIS,   1,   MAP_ABSOLUTE);
  MapAxis(  &Dev,   SCX,        DX_XROT_AXIS,     1,   MAP_ABSOLUTE);
  MapAxis(  &Dev,   SCY,        DX_YROT_AXIS,     1,   MAP_ABSOLUTE);

Now, here is the axes assignation from the TFRP mapping file (MapTFRPRudder.tmh) :

  MapAxis(  &Dev,   TRPRIGHT,       DX_XROT_AXIS,   1,   MAP_ABSOLUTE);
  MapAxis(  &Dev,   TRPLEFT,        DX_YROT_AXIS,   1,   MAP_ABSOLUTE);
  MapAxis(  &Dev,   TRUDDER,        DX_ZROT_AXIS,   1,   MAP_ABSOLUTE);

As you can see, both share the same virtual device axes, that's why your rudder and throttle share the same axes of the Virtual Device. To avoid that you have to make choice and reorganize the current axes assignations. If you want to keep using your rudder's 3 axes, you'll have to sacrify Thottle axes since there is only 8 availables virtual device axis, they are the following :

  • DX_X_AXIS
  • DX_Y_AXIS
  • DX_Z_AXIS
  • DX_XROT_AXIS
  • DX_YROT_AXIS
  • DX_ZROT_AXIS
  • DX_THROTTLE_AXIS
  • DX_SLIDER_AXIS

If you want to go further and perform more complexe code adjustement, please consider reading the TARGET Script Editor manual:
https://ts.thrustmaster.com/download/accessories/pc/hotas/software/target/target_script_editor_basics_v1.5_eng.pdf

Link to comment
Share on other sites

5 hours ago, sedenion said:

 

 

Like other axes, you have to add axis mapping curves functions calls using proper parameters. Since this is the TFRP T.Flight Rudder Pedals you can edit the MapTFRPRudder.tmh file and write the proper function call, either or J curve or S curve depending your needs, for example:

  // store device alias
  alias Dev = &TFRPRudder;
  
  // buttons and axes mapping here
  SetSCurve(&Dev,   TRPRIGHT,     5, 0, 5,  0, 0);
  SetSCurve(&Dev,   TRPLEFT,      5, 0, 5,  0, 0);
  SetSCurve(&Dev,   TRUDDER,      5, 0, 5,  0, 0);

 

If you include new hardware device to be "mapped" by script, you have to modify the axes assignations for the virtual device. The axes assignation (hardware device axis -> virtual device axis) is done using the MapAxis() function. You'll see call to this function at bottom of each relevant mapping script file. For exemple, here is how Warthog Throttle axes are mapped (MapThrottle.tmh):

  // -- Axes Assignment --------------------------------------------------------
  MapAxis(  &Dev,   THR_LEFT,   DX_ZROT_AXIS,     1,   MAP_ABSOLUTE);
  MapAxis(  &Dev,   THR_RIGHT,  DX_Z_AXIS,        1,   MAP_ABSOLUTE);
  MapAxis(  &Dev,   THR_FC,     DX_SLIDER_AXIS,   1,   MAP_ABSOLUTE);
  MapAxis(  &Dev,   SCX,        DX_XROT_AXIS,     1,   MAP_ABSOLUTE);
  MapAxis(  &Dev,   SCY,        DX_YROT_AXIS,     1,   MAP_ABSOLUTE);

Now, here is the axes assignation from the TFRP mapping file (MapTFRPRudder.tmh) :

  MapAxis(  &Dev,   TRPRIGHT,       DX_XROT_AXIS,   1,   MAP_ABSOLUTE);
  MapAxis(  &Dev,   TRPLEFT,        DX_YROT_AXIS,   1,   MAP_ABSOLUTE);
  MapAxis(  &Dev,   TRUDDER,        DX_ZROT_AXIS,   1,   MAP_ABSOLUTE);

As you can see, both share the same virtual device axes, that's why your rudder and throttle share the same axes of the Virtual Device. To avoid that you have to make choice and reorganize the current axes assignations. If you want to keep using your rudder's 3 axes, you'll have to sacrify Thottle axes since there is only 8 availables virtual device axis, they are the following :

  • DX_X_AXIS
  • DX_Y_AXIS
  • DX_Z_AXIS
  • DX_XROT_AXIS
  • DX_YROT_AXIS
  • DX_ZROT_AXIS
  • DX_THROTTLE_AXIS
  • DX_SLIDER_AXIS

If you want to go further and perform more complexe code adjustement, please consider reading the TARGET Script Editor manual:
https://ts.thrustmaster.com/download/accessories/pc/hotas/software/target/target_script_editor_basics_v1.5_eng.pdf

Alas target script editor is way over my head. In CH Manager it was waaaaay much easier, in the UI you could choose from the drop down virtual Joy 0, Joy 1 etc each  having its 8 axes. And any software recognized it quite easy. I understand Target requires more programming skills. There's no way I can give up throttle for the rudder. Can I just give up right/left brakes functionality for just one brake axis (all flight sims accept it) plus the throttle axis? What edits will be required to add to the above?

Many thanks.

PS otherwise is it difficult to make Target generate TFRPRudder virtual axes as Joy 1 device?


Edited by Sabre
Link to comment
Share on other sites

6 hours ago, sedenion said:

If you want to keep using your rudder's 3 axes, you'll have to sacrify Thottle axes since there is only 8 availables virtual device axis, they are the following :

  • DX_X_AXIS
  • DX_Y_AXIS
  • DX_Z_AXIS
  • DX_XROT_AXIS
  • DX_YROT_AXIS
  • DX_ZROT_AXIS
  • DX_THROTTLE_AXIS
  • DX_SLIDER_AXIS

If you want to go further and perform more complexe code adjustement, please consider reading the TARGET Script Editor manual:
https://ts.thrustmaster.com/download/accessories/pc/hotas/software/target/target_script_editor_basics_v1.5_eng.pdf

This! I can easily sacrifice my right throttle axis and keep the rest. I never use separate engine thrust controls anyway. I'll try to reorganized as you suggested sedenion.

Thanks.

Link to comment
Share on other sites

7 hours ago, sedenion said:

If you want to keep using your rudder's 3 axes, you'll have to sacrify Thottle axes since there is only 8 availables virtual device axis, they are the following :

  • DX_X_AXIS
  • DX_Y_AXIS
  • DX_Z_AXIS
  • DX_XROT_AXIS
  • DX_YROT_AXIS
  • DX_ZROT_AXIS
  • DX_THROTTLE_AXIS
  • DX_SLIDER_AXIS

It has worked like a charm! No right throttle axis anymore but I don't need it and I've never used it in any simulator anyway.

Link to comment
Share on other sites

On 9/17/2022 at 8:23 AM, sedenion said:

 

// Disable the original function call by adding // at begining of line
// SetJCurve(&Dev,   THR_FC,     CJ_THR_FC[0],     CJ_THR_FC[1]); 

// Add new SetSCurve() call for THR_FC with desired parameters
SetSCurve(&Dev,   THR_FC,     5, 0, 5,  0, 0);

What do these values in S curve represent? What do they control?

5, 0, 5,  0, 0

Thanks!


Edited by Sabre
Link to comment
Share on other sites

sedenion, based on your terrific support I've made my little project as follows:

1. I decided to add  T.Flight Rudder Pedals to Thrustmaster Combined game controller based on your scripts and some more details above. I wanted to do that because I wanted to add a desired dead zone and certain response curve to my liking within Target scripts.

2. Sedenion reminded me that I should maintain 8-axes limit and explained how to reconfiger the virtual joystick per my needs . So I gave up the right joystick throttle axis Z and assigned rudder control to it instead:

In MapThrottle.tmh I commented out:

//MapAxis(  &Dev,   THR_RIGHT,  DX_Z_AXIS,        1,   MAP_ABSOLUTE);

and added axis mapping curves functions calls to MapTFRPRudder.tmh as sendon advised earlier:

  // buttons and axes mapping here
  SetSCurve(&Dev,   TRPRIGHT,     5, 0, 5,  0, 0);
  SetSCurve(&Dev,   TRPLEFT,      5, 0, 5,  0, 0);
  SetSCurve(&Dev,   TRUDDER,      5, 0, 5,  0, 0);

 3. To be able to adjust the dead zone and response cure of the Rudder axis in Run_Complete.tmc I made the following edits:

a) in MapTFRPRudder.tmh I commented out and added the following:

 // SetSCurve(&Dev,   TRUDDER,      5, 0, 5,  0, 0);
  SetSCurve(&Dev,  TRUDDER,  CS_TRUDDER[0], CS_TRUDDER[1], CS_TRUDDER[2], CS_TRUDDER[3], CS_TRUDDER[4]);

b) Then I added the following line (shown in bold) to Run_Complete.tmc:

int CS_JOYX[5]      = { 0,  11,  0,  2,  0 };  //< Joystick JOYX
int CS_JOYY[5]      = { 0,  11,  0,  2,  0 };  //< Joystick JOYY
int CS_TRUDDER[5]        = { 0,  40,  0,  8,  0 };  //< Joystick TRUDDER MY EDIT, NOT SURE IF CORRECT

4. Then I reassigned my axes in the sim as needed. Now the T.Flight Rudder Pedals are in the Combined game controller and the dead zone and response curve are adjusted as I wanted them to be.

Thanks again sedenion for your help!


Edited by Sabre
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...