@Opiate987 I butchered Sedenion's DX++ profile from the EA forums for my needs in DCS and just literally flipped the axis over, some of it i use some not so much, some of the buttons don't seem to be detected in SWS, i haven't really done the diagnostics on exactly what or why yet
// -----------------------------------------------------------------------------
// HOTAS Warthog DX++ Mapping
// -----------------------------------------------------------------------------
// Main script file
// Version: 2.1
// Author: Sedenion
// Modified: Badger
// Date: 09-JUN-2020
// -----------------------------------------------------------------------------
// Desc:
// DSC script file
// -----------------------------------------------------------------------------
// Change Log:
// 10-05-2020 Updated code in Main and tidied spaces to tabs...
// 05-10-2020 Updated to fix Star Wars Squadrons
/* MapAxis ( &Joystick, JOYX, DX_XROT_AXIS, AXIS_NORMAL, MAP_ABSOLUTE);
MapAxis ( &Joystick, JOYY, DX_YROT_AXIS, AXIS_NORMAL, MAP_ABSOLUTE);
MapAxis ( &Throttle, SCX, DX_X_AXIS, AXIS_NORMAL, MAP_ABSOLUTE);
MapAxis ( &Throttle, SCY, DX_Y_AXIS, AXIS_NORMAL, MAP_ABSOLUTE); */
// SC axis and Joy axis swapped over
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
// Custom config
// -----------------------------------------------------------------------------
// Shift-Submode Config
// -----------------------------------------------------------------------------
define SHIFT_ENABLED 1 // Enable ⚽ or Disable (0) Shift Submode
define SHIFT_DEV Joystick // Shift-Submode activation Button Device
define SHIFT_BTN H4P // Shift-Submode activation Button ID
// Button & Hat Shift-Submode Activation
// -----------------------------------------------------------------------------
define H3_SHIFT 0 // Enable ⚽ or Disable (0) Shift-Submode for Hat 1
define H4_SHIFT 1 // Enable ⚽ or Disable (0) Shift-Submode for Hat 1
define BS_SHIFT 0 // Enable ⚽ or Disable (0) Shift-Submode for Boat Switch
// Button & Hat Long-Press Activation
// -----------------------------------------------------------------------------
define S1_LONG 1 // Enable ⚽ or Disable (0) Long-Press for S1 button
define S2_LONG 1 // Enable ⚽ or Disable (0) Long-Press for S2 button
define S3_LONG 1 // Enable ⚽ or Disable (0) Long-Press for S3 button
define S4_LONG 1 // Enable ⚽ or Disable (0) Long-Press for S4 button
define H2_LONG 1 // Enable ⚽ or Disable (0) Long-Press for Hat 2 L & R
define LTB_LONG 1 // Enable ⚽ or Disable (0) Long-Press for LTB button
define CS_LONG 1 // Enable ⚽ or Disable (0) Long-Press for CS Hat U & D
define CH_LONG 1 // Enable ⚽ or Disable (0) Long-Press for China Hat
define AP_LONG 1 // Enable ⚽ or Disable (0) Long-Press for AP button
define LDGH_LONG 1 // Enable ⚽ or Disable (0) Long-Press for LDGH button
// Common LED Config
// -----------------------------------------------------------------------------
define LED_BRIGHTNESS 0 // LED brightness level (0-255)
define LED_BACKLIGHT 0 // Enable ⚽ or Disable (0) LED Backlight
// Button-controlled LED Mapping
// -----------------------------------------------------------------------------
define LED1_CONTROL 0 // Enable ⚽ or Disable (0) Controlled LED1
define LED1_DEV Throttle // LED1 Controll Button Device
define LED1_BTN -1 // LED1 Controll Button ID
define LED2_CONTROL 1 // Enable ⚽ or Disable (0) Controlled LED2
define LED2_DEV Throttle // LED2 Controll Button Device
define LED2_BTN APUON // LED2 Controll Button ID
define LED3_CONTROL 1 // Enable ⚽ or Disable (0) Controlled LED3
define LED3_DEV Throttle // LED3 Controll Button Device
define LED3_BTN RDRNRM // LED3 Controll Button ID
define LED4_CONTROL 1 // Enable ⚽ or Disable (0) Controlled LED4
define LED4_DEV Throttle // LED4 Controll Button Device
define LED4_BTN EACON // LED4 Controll Button ID
define LED5_CONTROL 1 // Enable ⚽ or Disable (0) Controlled LED5
define LED5_DEV Throttle // LED5 Controll Button Device
define LED5_BTN FLAPD // LED5 Controll Button ID
// -----------------------------------------------------------------------------
// Includes
// -----------------------------------------------------------------------------
include "target.tmh" // Standard TM Header
include "include/dx+.tmh" // DX++ Module
include "include/pov.tmh" // Custom POV Hat module
include "include/ldc.tmh" // LED Control module
// -----------------------------------------------------------------------------
// Event callback
// -----------------------------------------------------------------------------
int EventHandle (int type, alias o, int x)
{
// Default mapping callback call
DefaultMapping (&o, x);
// Custom Modules callback calls
PovMapping (&o, x);
LDcMapping (&o, x);
}
// Main entry
// -----------------------------------------------------------------------------
int main()
{
// ----------------------- Exclude unused devices ----------------------------
Configure ( &HCougar, MODE_EXCLUDED);
Configure ( &T16000, MODE_EXCLUDED);
Configure ( &T16000L, MODE_EXCLUDED);
Configure ( &TWCSThrottle, MODE_EXCLUDED);
Configure ( &LMFD, MODE_EXCLUDED);
Configure ( &RMFD, MODE_EXCLUDED);
Configure ( &TFRPRudder, MODE_EXCLUDED);
Configure ( &TFRPHARudder, MODE_EXCLUDED);
Configure ( &JoystickF18, MODE_EXCLUDED);
// Configure ( &Joystick, MODE_EXCLUDED);
// Configure ( &Throttle, MODE_EXCLUDED);
// ------------------------- Event Callback Init -----------------------------
// Even Callback Btn count Joystick, Mouse and Keyboard
DXpInit ( &EventHandle, 104, CREATE_JOYSTICK+CREATE_MOUSE+CREATE_KEYBOARD);
// --------------------------- Global setup ----------------------------------
// Pulse Delay
SetKBRate ( 50, 50);
SetKBLayout (KB_ENG);
if ( SHIFT_ENABLED)
{
SetShiftButton ( &SHIFT_DEV, SHIFT_BTN, 0, 0, 0, 0);
}
/* int LONG_SHIFT = 0;
if (LONG_SHIFT)
{
printf("Value of LONG_SHIFT %s\xa", &LONG_SHIFT);
} */
/////////////////////////////
// ** JOYSTICK BUTTONS ** //
/////////////////////////////
// GUN TRIGGER 1 & 2 //
MapKey ( &Joystick, TG1, DX1);
MapKey ( &Joystick, TG2, DX2);
// MASTER MODE //
// MAPS MASTER MODE as as DX3 OR RMB Press slightly below line of vision with SHIFR (HP Reverb in full screen)
// MapKeyIO (&Joystick, S1, CHAIN ( EXEC ( "DXAxis ( MOUSE_X_AXIS, -14000);" "DXAxis ( MOUSE_Y_AXIS, 25000);"), MOUSE_RIGHT),
MapKeyIO (&Joystick, S1, DX101,
DX3);
// WEAPON RELEASE //
MapKey ( &Joystick, S2, DX4);
// NWS //
MapKeyIO ( &Joystick, S3, DX90, DX5);
// PADDLE //
MapKeyIO ( &Joystick, S4, DX91, DX6);
// TRIM HAT //
SetPov ( &Joystick, H1);
/* MapKey ( &Joystick, H1U, DXHATUP);
MapKey ( &Joystick, H1D, DXHATDOWN);
MapKey ( &Joystick, H1L, DXHATLEFT);
MapKey ( &Joystick, H1R, DXHATRIGHT);*/
// TMS //
MapKey ( &Joystick, H2U, DX11);
MapKey ( &Joystick, H2D, DX12);
MapKey ( &Joystick, H2L, DX13);
MapKey ( &Joystick, H2R, DX14);
// DMS //
MapKey ( &Joystick, H3U, DX15);
MapKey ( &Joystick, H3D, DX16);
MapKey ( &Joystick, H3L, TEMPO ( DX17,
DX78, 500)); //acts as a DMS depress on a long press
MapKey ( &Joystick, H3R, DX18);
// CMS //
MapKeyIO ( &Joystick, H4U, 0, DX19);
MapKeyIO ( &Joystick, H4D, 0, DX20);
MapKeyIO ( &Joystick, H4L, 0, DX21);
MapKeyIO ( &Joystick, H4R, 0, DX22);
MapKey ( &Joystick, H4P, TEMPO ( DX23,
0, 300)); // Null in Long press for SHIFT Key
/////////////////////////////
// ** THROTTLE BUTTONS ** //
/////////////////////////////
// TDC DEPRESS //
MapKey ( &Throttle, SC, DX25);
// MIC SWITCH //
MapKeyIO ( &Throttle, MSP, DX75, DX26);
// MapKeyIO ( &Throttle, MSU, AXIS ( MOUSE_Z_AXIS, 1, 75),
MapKeyIO ( &Throttle, MSU, DX102,
DX27); // MOUSE SCROLL UP/ DX27
// MapKeyIO ( &Throttle, MSR, DX76, DX28);
// SSP=SHIFTED SHORT PRESS
// SLP=SHIFTED LONG PRESS SSP SLP
MapKeyIO ( &Throttle, MSR, TEMPO ( DX95, DX76, 500),
DX28);
// MapKeyIO ( &Throttle, MSD, AXIS ( MOUSE_Z_AXIS, -1, 75),
MapKeyIO ( &Throttle, MSD, DX103,
DX29); // MOUSE SCROLL DOWN/ DX29
// MapKeyIO ( &Throttle, MSL, DX77, DX30);
// SSP=SHIFTED SHORT PRESS
// SLP=SHIFTED LONG PRESS SSP SLP
MapKeyIO ( &Throttle, MSL, TEMPO ( DX96, DX77, 500),
DX30);
/* MapKeyIO ( &Throttle, MSL, TEMPO ( DX96, PULSE+L_CTL+L_SHIFT+'X', 300),
DX30); // Long press "in" will activate and deactivate scratchpad */
// SPEEDBRAKE //
MapKey ( &Throttle, SPDF, DX31);
MapKey ( &Throttle, SPDM, PULSE+DX32);
MapKey ( &Throttle, SPDB, DX33);
// COOLIE SWITCH //
/* MapKeyIO ( &Throttle, CSU, DX83, DX34);
MapKeyIO ( &Throttle, CSD, DX84, DX35);
MapKeyIO ( &Throttle, CSR, DX85, DX37);
MapKeyIO ( &Throttle, CSL, DX86, DX38); */
MapKeyIO ( &Throttle, CSU, DX83, TEMPO ( DX34,
DX97, 500));
MapKeyIO ( &Throttle, CSD, DX84, TEMPO ( DX35,
DX98, 500));
MapKeyIO ( &Throttle, CSR, DX85, TEMPO ( DX37,
DX99, 500));
MapKeyIO ( &Throttle, CSL, DX86, TEMPO ( DX38,
DX100, 500));
// BOATSWITCH (AKA Mode Switch)//
/* MapKey ( &Throttle, BSF, PULSE+DX39);
MapKey ( &Throttle, BSM, PULSE+DX40);
MapKey ( &Throttle, BSB, PULSE+DX41); */
MapKey ( &Throttle, BSF, DX39);
MapKey ( &Throttle, BSM, DX40);
MapKey ( &Throttle, BSB, DX41);
// CHINA HAT //
MapKeyIO ( &Throttle, CHF, DX79, DX42);
MapKey ( &Throttle, CHM, PULSE+DX43);
MapKeyIO ( &Throttle, CHB, DX80, DX44);
// PNKY SWITCH //
MapKeyIO ( &Throttle, PSF, DX87,
PULSE+DX45);
MapKeyIO ( &Throttle, PSM, PULSE+DX88,
PULSE+DX46);
MapKeyIO ( &Throttle, PSB, PULSE+DX89,
PULSE+DX47);
// LEFT THROTTLE BUTTON //
// MAPS LEFT THROTTLE BUTTON as DX48 OR LMB Press slightly below line of vision with SHIFT (HP Reverb in full screen)
// MapKeyIO ( &Throttle, LTB, CHAIN ( EXEC ( "DXAxis ( MOUSE_X_AXIS, -14000);" "DXAxis(MOUSE_Y_AXIS, 25000);" ), MOUSE_LEFT),
MapKeyIO ( &Throttle, LTB, DX104,
DX48);
// Engine Flow Normal//
MapKey ( &Throttle, EFLNORM, PULSE+DX49);
MapKey ( &Throttle, EFRNORM, PULSE+DX50);
// Engine Flow Override//
MapKey ( &Throttle, EFLOVER, PULSE+DX51);
MapKey ( &Throttle, EFROVER, PULSE+DX52);
// ENG OPER IGN //
MapKey ( &Throttle, EOLIGN, PULSE+DX53);
MapKey ( &Throttle, EORIGN, PULSE+DX54);
// ENG OPER MOTOR//
MapKey ( &Throttle, EOLMOTOR, PULSE+DX55);
MapKey ( &Throttle, EORMOTOR, PULSE+DX56);
// APU //
MapKeyIO ( &Throttle, APUON, PULSE+DX36, PULSE+DX57);
MapKeyIO ( &Throttle, APUOFF, DX81, DX58);
// LANDING GEAR HORN SILENCE//
MapKey ( &Throttle, LDGH, PULSE+DX59);
// FLAPS //
MapKey ( &Throttle, FLAPU, PULSE+DX60);
MapKey ( &Throttle, FLAPM, PULSE+DX61);
MapKey ( &Throttle, FLAPD, PULSE+DX62);
// EAC/MASTER ARM //
MapKey ( &Throttle, EACON, PULSE+DX63);
MapKey ( &Throttle, EACOFF, PULSE+DX64);
// RADAR ALTM //
MapKey ( &Throttle, RDRNRM, PULSE+DX65);
MapKey ( &Throttle, RDRDIS, PULSE+DX66);
// AUTOPILOT //
MapKey ( &Throttle, APENG, PULSE+DX67); // Autopilot Engage //
MapKeyIO ( &Throttle, APPAT, PULSE+DX92, PULSE+DX68); // Autopilot Path //
MapKeyIO ( &Throttle, APAH, PULSE+DX93, PULSE+DX69); // Autopilot Alt/Hdg //
MapKeyIO ( &Throttle, APALT, PULSE+DX94, PULSE+DX70); // Autopilot Alt //
// ENGINE IDLE //
MapKey ( &Throttle, IDLERON, PULSE+DX71);
MapKey ( &Throttle, IDLELON, PULSE+DX72);
MapKey ( &Throttle, IDLEROFF, PULSE+DX73);
MapKey ( &Throttle, IDLELOFF, PULSE+DX74);
// ------------------------------ Axis Mapping -------------------------------
// DX Axis Mapping
// Device TM Axis DX Axis NORMAL/REVERSED ABSOLUTE/RELATIVE
MapAxis ( &Joystick, JOYX, DX_XROT_AXIS, AXIS_NORMAL, MAP_ABSOLUTE);
MapAxis ( &Joystick, JOYY, DX_YROT_AXIS, AXIS_NORMAL, MAP_ABSOLUTE);
MapAxis ( &Throttle, SCX, DX_X_AXIS, AXIS_NORMAL, MAP_ABSOLUTE);
MapAxis ( &Throttle, SCY, DX_Y_AXIS, AXIS_NORMAL, MAP_ABSOLUTE);
MapAxis ( &Throttle, THR_RIGHT, DX_Z_AXIS, AXIS_NORMAL, MAP_ABSOLUTE);
MapAxis ( &Throttle, THR_LEFT, DX_ZROT_AXIS, AXIS_NORMAL, MAP_ABSOLUTE);
MapAxis ( &Throttle, THR_FC, DX_SLIDER_AXIS, AXIS_NORMAL, MAP_ABSOLUTE);
// Axis Curves
// Device TM Axis Left-DZ Center-DZ Right-DZ Curve Scale/Zoom
SetSCurve ( &Joystick, JOYX, 0, 0, 0, 0, 0);
SetSCurve ( &Joystick, JOYY, 0, 0, 0, 0, 0);
SetSCurve ( &Throttle, SCX, 0, 0, 0, 0, 0);
SetSCurve ( &Throttle, SCY, 0, 0, 0, 0, 0);
SetSCurve ( &Throttle, THR_RIGHT, 0, 0, 0, 0, 0);
SetSCurve ( &Throttle, THR_LEFT, 0, 0, 0, 0, 0);
SetSCurve ( &Throttle, THR_FC, 0, 0, 0, 0, 0);
// ----------------------------- LED Mapping ---------------------------------
// Device Intensity
LedIntensity( &Throttle, LED_BRIGHTNESS );
// Device LED Enable/Disable
LedEnable( &Throttle, LED0, LED_BACKLIGHT ); // Backlight
if(LED1_BTN != -1) {
// Device BTN Device LED CONTROL MODE
MapLed( &LED1_DEV, LED1_BTN, &Throttle, LED2, LED_ONPRESS );
} else {
// Device LED Enable/Disable
LedEnable( &Throttle, LED1, 0 );
}
if(LED2_BTN != -1) {
// Device BTN Device LED CONTROL MODE
MapLed( &LED2_DEV, LED2_BTN, &Throttle, LED2, LED_ONPRESS );
} else {
// Device LED Enable/Disable
LedEnable( &Throttle, LED2, 0 );
}
if(LED3_BTN != -1) {
// Device BTN Device LED CONTROL MODE
MapLed( &LED3_DEV, LED3_BTN, &Throttle, LED3, LED_ONPRESS );
} else {
// Device LED Enable/Disable
LedEnable( &Throttle, LED3, 0 );
}
if(LED4_BTN != -1) {
// Device BTN Device LED CONTROL MODE
MapLed( &LED4_DEV, LED4_BTN, &Throttle, LED4, LED_ONPRESS );
} else {
// Device LED Enable/Disable
LedEnable( &Throttle, LED4, 0 );
}
if(LED5_BTN != -1) {
// Device BTN Device LED CONTROL MODE
MapLed( &LED5_DEV, LED5_BTN, &Throttle, LED5, LED_ONPRESS );
} else {
// Device LED Enable/Disable
LedEnable( &Throttle, LED5, 0 );
}
}