Jump to content

TARGET - Advanced programming


ivanwfr

Recommended Posts

  • 3 weeks later...

Advice needed

 

Howdy,

 

I'm not programmer but I like to get more out of my TM so I started to try understand can I switch between two configs on my TM on the fly.

 

I found found this (and edited it little)...it will not work as I think it should.

 

This code is working at default state, HAT4U will send v-letter and HAT3U nothing (like it should do) but after I switch from FA18 to F16 then both will send letters..HAT4 v-letter and HAT3 r-letter. And if I change HAT3 to HAT4 then joystick buttons wont send anything..I can't even change profile anymore..but throttle is sending key strokes. So is this code missing some brake thing (which ever you call it)?

 

 

// ==========================================================

include "target.tmh"
include "DCS_Default.ttm"
include "DCS_1.ttm"
include "DCS_2.ttm"

int main()
{
if(Init(&EventHandle)) return 1;

//******************************************************************
// Common config for Pilot and RIO
//******************************************************************
// This config will be set up once and never changed.  Settings are for both Pilot and RIO.

//******************************************************************
//	Setup some basic settings

// Configure exlude list
Configure(&T16000,MODE_EXCLUDED);
Configure(&T16000L,MODE_EXCLUDED);
Configure(&TWCSThrottle,MODE_EXCLUDED);
Configure(&HCougar,MODE_EXCLUDED);
Configure(&LMFD,MODE_EXCLUDED); 
Configure(&RMFD,MODE_EXCLUDED);
Configure(&TFRPRudder,MODE_EXCLUDED);
Configure(&TFRPHARudder,MODE_EXCLUDED);
//Configure(&Throttle,MODE_EXCLUDED);

SetKBLayout(KB_ENG);			// this file designed for English keyboard.
SetShiftButton(&Joystick, S3, &Throttle, 0, 0, 0);		// IO Shift and UMD Setup   


//******************************************************************
//	Map DirectX axis

// JoyX, JoyY
MapAxis(&Joystick, JOYX, DX_X_AXIS, AXIS_NORMAL, MAP_ABSOLUTE);
MapAxis(&Joystick, JOYY, DX_Y_AXIS, AXIS_NORMAL, MAP_ABSOLUTE);

// Throttle - Left and Right
MapAxis(&Throttle, THR_RIGHT, DX_Z_AXIS, AXIS_NORMAL, MAP_ABSOLUTE);
MapAxis(&Throttle, THR_LEFT, DX_ZROT_AXIS, AXIS_NORMAL, MAP_ABSOLUTE);

// Slew Control
MapAxis(&Throttle, SCX, DX_XROT_AXIS, AXIS_NORMAL, MAP_ABSOLUTE);
MapAxis(&Throttle, SCY, DX_YROT_AXIS, AXIS_NORMAL, MAP_ABSOLUTE);

// Throttle Friction Control
MapAxis(&Throttle, THR_FC, DX_SLIDER_AXIS, AXIS_NORMAL, MAP_ABSOLUTE);


//******************************************************************
//	Throttle Controls

// Coolie Switch (HAT)
MapKeyIO(&Throttle, CSU, 0, DCS_ZoomInSlow);
MapKeyIO(&Throttle, CSD, 0, DCS_ZoomOutSlow);	
MapKeyIO(&Throttle, CSL, 0, DCS_LabelsAll);
MapKeyIO(&Throttle, CSR, 0, DCS_ZoomNormal);

printf("----------------------------------\xa");

SetUpFA18();			// Configure FA18 specific mappings.  (Default to Pilot config on startup)

}	// end main()


int SetUpFA18()
{
printf("Setting up config for FA18...\xa");

// Swap to F16config when shifted Left Throttle Button pressed
MapKeyIO(&Throttle, LTB, EXEC("SetUpF16();"), 0);

//  ...
MapKey(&Joystick, H4U, DCS_1_Macro); // v -letter

}

int SetUpF16()
{
printf("Setting up config for F16...\xa");

// Swap to FA18 config when shifted Left Throttle Button pressed
MapKeyIO(&Throttle, LTB, EXEC("SetUpFA18();"), 0);

// Place all RIO specific configs here
// This can include all normal config commands like MapKey, MapAxis, etc
//  ...
MapKey(&Joystick, H3U, DCS_2_Macro); r -letter

}


//******************************************************************
int EventHandle(int type, alias o, int x)
{
DefaultMapping(&o, x);
}
//******************************************************************


Edited by Iku64

 

[sIGPIC][/sIGPIC]

HP Z420 | Xeon E5-1650 @3.20GHz/3.70Ghz | 16Gb DDR3-1333 | ZOTAC GTX 980 Ti AMP! | Micron RealSSD C400 256Gb | Sound Blaster Z | TrackIR4 | Thrustmaster HOTAS Warthog| CH Pro pedals | Win 10 Pro 64-bit

 

Link to comment
Share on other sites

Try it now

// ==========================================================

include "target.tmh"
include "DCS_Default.ttm"
include "DCS_1.ttm"
include "DCS_2.ttm"

int main()
{
   if(Init(&EventHandle)) return 1;
   
   //******************************************************************
   // Common config for Pilot and RIO
   //******************************************************************
   // This config will be set up once and never changed.  Settings are for both Pilot and RIO.

   //******************************************************************
   //    Setup some basic settings
   
   // Configure exlude list
   Configure(&T16000,MODE_EXCLUDED);
   Configure(&T16000L,MODE_EXCLUDED);
   Configure(&TWCSThrottle,MODE_EXCLUDED);
   Configure(&HCougar,MODE_EXCLUDED);
   Configure(&LMFD,MODE_EXCLUDED); 
   Configure(&RMFD,MODE_EXCLUDED);
   Configure(&TFRPRudder,MODE_EXCLUDED);
   Configure(&TFRPHARudder,MODE_EXCLUDED);
   //Configure(&Throttle,MODE_EXCLUDED);

   SetKBLayout(KB_ENG);            // this file designed for English keyboard.
   SetShiftButton(&Joystick, S3, &Throttle, 0, 0, 0);        // IO Shift and UMD Setup   

   
   //******************************************************************
   //    Map DirectX axis

   // JoyX, JoyY
   MapAxis(&Joystick, JOYX, DX_X_AXIS, AXIS_NORMAL, MAP_ABSOLUTE);
   MapAxis(&Joystick, JOYY, DX_Y_AXIS, AXIS_NORMAL, MAP_ABSOLUTE);
   
   // Throttle - Left and Right
   MapAxis(&Throttle, THR_RIGHT, DX_Z_AXIS, AXIS_NORMAL, MAP_ABSOLUTE);
   MapAxis(&Throttle, THR_LEFT, DX_ZROT_AXIS, AXIS_NORMAL, MAP_ABSOLUTE);
   
   // Slew Control
   MapAxis(&Throttle, SCX, DX_XROT_AXIS, AXIS_NORMAL, MAP_ABSOLUTE);
   MapAxis(&Throttle, SCY, DX_YROT_AXIS, AXIS_NORMAL, MAP_ABSOLUTE);

   // Throttle Friction Control
   MapAxis(&Throttle, THR_FC, DX_SLIDER_AXIS, AXIS_NORMAL, MAP_ABSOLUTE);
   

   //******************************************************************
   //    Throttle Controls

   // Coolie Switch (HAT)
   MapKeyIO(&Throttle, CSU, 0, DCS_ZoomInSlow);
   MapKeyIO(&Throttle, CSD, 0, DCS_ZoomOutSlow);    
   MapKeyIO(&Throttle, CSL, 0, DCS_LabelsAll);
   MapKeyIO(&Throttle, CSR, 0, DCS_ZoomNormal);
   
   printf("----------------------------------\xa");

   SetUpFA18();            // Configure FA18 specific mappings.  (Default to Pilot config on startup)

}    // end main()
   

int SetUpFA18()
{
   printf("Setting up config for FA18...\xa");

   // Swap to F16config when shifted Left Throttle Button pressed
   MapKeyIO(&Throttle, LTB, EXEC("SetUpF16();"), 0);
   
   //  ...
   MapKey(&Joystick, H4U, DCS_1_Macro); // v -letter
   
}

int SetUpF16()
{
   printf("Setting up config for F16...\xa");

   // Swap to FA18 config when shifted Left Throttle Button pressed
   MapKeyIO(&Throttle, LTB, EXEC("SetUpFA18();"), 0);
   
   // Place all RIO specific configs here
   // This can include all normal config commands like MapKey, MapAxis, etc
   //  ...
   MapKey(&Joystick, H3U, DCS_2_Macro); // r -letter
   
}


//******************************************************************
int EventHandle(int type, alias o, int x)
{
   DefaultMapping(&o, x);
}
//******************************************************************

 

 

What was the error TARGET threw out?

Night Ops in the Harrier

IYAOYAS


 
Link to comment
Share on other sites

no error..as I said..if FA18 have HAT4U and F16 HAT3U the it will work..but after switch both hats send keys...and if both are mapped to HAT4U..then it will stuck...

 

Okei..I tested...and now it's working like it should be if both HAT's are HAT4U..but if they are different..then after swithing from FA18 to F16..both hats send keys...

 

I attached screenshot

After start I pressed 2 times HAT4U, then I switched to F16...then pressed HAT3U 2 times...and HAT4U 2 times...as you can see..both works after switch..

 

BTW..what did you do..I can't find difference..

 

Also..funny thing is that it will find T-Rudder...even I have TFRPRudder..and I have exluded it it.

 

Running script: D:\Games\A_Games\Thrustmaster\Warthog\Profiles\DCS_Iku\DCS.tmc

*** Allocated ProcInstances found from the previous run: use FreeProcInstance() ***

Mapped plugin module "C:\Program Files (x86)\Thrustmaster\TARGET\Plugins\sys.dll"

Compile Succeeded.

Physical USB HID devices managed by script!

Currently plugged USB HID devices[3]:

1: "Joystick - HOTAS Warthog" - "USB\VID_044F&PID_0402&REV_0100"

2: "Throttle - HOTAS Warthog" - "USB\VID_044F&PID_0404&REV_0100"

3: "T-Rudder" - "USB\VID_044F&PID_B679&REV_0110"

USB HID device "Throttle - HOTAS Warthog"(USB\VID_044F&PID_0404\6&365F2879&2&3) selected

USB HID device "Joystick - HOTAS Warthog"(USB\VID_044F&PID_0402\6&365F2879&2&4) selected

USB HID device with hardware id "VID_044F&PID_0403" cannot be found

USB HID device with hardware id "VID_044F&PID_b351" cannot be found

USB HID device with hardware id "VID_044F&PID_b352" cannot be found

USB HID device with hardware id "VID_044F&PID_0400" cannot be found

USB HID device with hardware id "VID_044F&PID_B10A" cannot be found

USB HID device with hardware id "VID_044F&PID_B10B" cannot be found

USB HID device with hardware id "VID_044F&PID_B687" cannot be found

USB HID device "T-Rudder"(USB\VID_044F&PID_B679\6&365F2879&2&2) selected

USB HID device with hardware id "VID_044F&PID_B68F" cannot be found

Virtual HID devices managed by script!

Connecting virtual joystick...Done

Device name set to Thrustmaster Combined

Connecting virtual keyboard...Done

Connecting virtual mouse (absolute axes)...Done

----------------------------------

Code_problem_01.jpg.a4bfa9dec4a92d06307e3da478c835da.jpg


Edited by Iku64

 

[sIGPIC][/sIGPIC]

HP Z420 | Xeon E5-1650 @3.20GHz/3.70Ghz | 16Gb DDR3-1333 | ZOTAC GTX 980 Ti AMP! | Micron RealSSD C400 256Gb | Sound Blaster Z | TrackIR4 | Thrustmaster HOTAS Warthog| CH Pro pedals | Win 10 Pro 64-bit

 

Link to comment
Share on other sites

BTW..what did you do..I can't find difference..

Line 92. You were missing double "//" in front of "r - Letter". That line needed to read like this

MapKey(&Joystick, H3U, DCS_1_Macro);[b] [color=Lime]//[/color][/b]r -Letter

Also..funny thing is that it will find T-Rudder...even I have TFRPRudder..and I have exluded it it.

Link where you got this script from, I'd like to what the T-Rudder is doing there.

Night Ops in the Harrier

IYAOYAS


 
Link to comment
Share on other sites

I'm not sure anymore..cause that "comment" was done after I decide to ask things...and I made some comments to script..so it was not there when I had a problem...hmm..wondering..:)

 

I "steal" code from here

https://forums.eagle.ru/showpost.php?p=3912150&postcount=124

 

[sIGPIC][/sIGPIC]

HP Z420 | Xeon E5-1650 @3.20GHz/3.70Ghz | 16Gb DDR3-1333 | ZOTAC GTX 980 Ti AMP! | Micron RealSSD C400 256Gb | Sound Blaster Z | TrackIR4 | Thrustmaster HOTAS Warthog| CH Pro pedals | Win 10 Pro 64-bit

 

Link to comment
Share on other sites

I'd like to what the T-Rudder is doing there.

 

I think this must be happend after I updatedet drivers. I checked folder "C:\Program Files (x86)\Thrustmaster\TARGET\DevCfg" and there code "USB\VID_044F&PID_B679&REV_0110" belongs to TFRPRudder (VID_044F&PID_B679_TFRPRudder.xaml).

 

But now all my scripts see my TFRP as "T-Rudder"

 

Running script: D:\Games\A_Games\Thrustmaster\Warthog\Profiles\DCS_FA-18C_Iku\DCS_FA-18C_Iku.tmc

*** Allocated ProcInstances found from the previous run: use FreeProcInstance() ***

Compile Succeeded.

Mapped plugin module "C:\Program Files (x86)\Thrustmaster\TARGET\Plugins\sys.dll"

Physical USB HID devices managed by script!

Currently plugged USB HID devices[3]:

1: "Joystick - HOTAS Warthog" - "USB\VID_044F&PID_0402&REV_0100"

2: "Throttle - HOTAS Warthog" - "USB\VID_044F&PID_0404&REV_0100"

3: "T-Rudder" - "USB\VID_044F&PID_B679&REV_0110"

 

I'm not sure but at file VID_044F&PID_B679.dev is SerialNo block where version is 1007..should it be 0110. So has driver update made this fault.

 

[sIGPIC][/sIGPIC]

HP Z420 | Xeon E5-1650 @3.20GHz/3.70Ghz | 16Gb DDR3-1333 | ZOTAC GTX 980 Ti AMP! | Micron RealSSD C400 256Gb | Sound Blaster Z | TrackIR4 | Thrustmaster HOTAS Warthog| CH Pro pedals | Win 10 Pro 64-bit

 

Link to comment
Share on other sites

Ok..now I found why this test script was loading rudder even it was blocked at list...exlude list was at wrong position...it took some time to see difference with comparing two files..:book:

It needs to be before line "if(Init(&EventHandle)) return 1;"

But still I'm wondering why it's named T-Rudder..:music_whistling:

 

Before

int main()
{

   if(Init(&EventHandle)) return 1;
   
   //******************************************************************
   // Common config for Pilot and RIO
   //******************************************************************
   // This config will be set up once and never changed.  Settings are for both Pilot and RIO.
   // Configure exlude list
   Configure(&T16000,MODE_EXCLUDED);
   Configure(&T16000L,MODE_EXCLUDED);
   Configure(&TWCSThrottle,MODE_EXCLUDED);
   Configure(&HCougar,MODE_EXCLUDED);
   Configure(&LMFD,MODE_EXCLUDED); 
   Configure(&RMFD,MODE_EXCLUDED);
   Configure(&TFRPRudder,MODE_EXCLUDED);
   Configure(&TFRPHARudder,MODE_EXCLUDED);
   //Configure(&Throttle,MODE_EXCLUDED);
   
   //******************************************************************

 

After

int main()
{

   // Configure exlude list
   Configure(&T16000,MODE_EXCLUDED);
   Configure(&T16000L,MODE_EXCLUDED);
   Configure(&TWCSThrottle,MODE_EXCLUDED);
   Configure(&HCougar,MODE_EXCLUDED);
   Configure(&LMFD,MODE_EXCLUDED); 
   Configure(&RMFD,MODE_EXCLUDED);
   Configure(&TFRPRudder,MODE_EXCLUDED);
   Configure(&TFRPHARudder,MODE_EXCLUDED);
   //Configure(&Throttle,MODE_EXCLUDED);
   
  if(Init(&EventHandle)) return 1;
   
   //******************************************************************
   // Common config for Pilot and RIO
   //******************************************************************
   // This config will be set up once and never changed.  Settings are for both Pilot and RIO.

   //******************************************************************

 

[sIGPIC][/sIGPIC]

HP Z420 | Xeon E5-1650 @3.20GHz/3.70Ghz | 16Gb DDR3-1333 | ZOTAC GTX 980 Ti AMP! | Micron RealSSD C400 256Gb | Sound Blaster Z | TrackIR4 | Thrustmaster HOTAS Warthog| CH Pro pedals | Win 10 Pro 64-bit

 

Link to comment
Share on other sites

Finally I understood :doh: that all these blocks see each other (of course) and thats why after switch I get other profile buttons if they are not reprogrammed at second profile.

 

Weird thing is that if you try to block other profile buttons with "0" then it get stuck. That's small problem if you don't want to use that button in other profile...is there other way around?

 

Here is my last working test code

 

// ==========================================================

include "target.tmh"
include "DCS_Default.ttm"
include "DCS_1.ttm"
include "DCS_2.ttm"

int main()
{

   // Configure exlude list
   Configure(&T16000,MODE_EXCLUDED);
   Configure(&T16000L,MODE_EXCLUDED);
   Configure(&TWCSThrottle,MODE_EXCLUDED);
   Configure(&HCougar,MODE_EXCLUDED);
   Configure(&LMFD,MODE_EXCLUDED); 
   Configure(&RMFD,MODE_EXCLUDED);
   Configure(&TFRPRudder,MODE_EXCLUDED);
   Configure(&TFRPHARudder,MODE_EXCLUDED);
   //Configure(&Throttle,MODE_EXCLUDED);
   
  if(Init(&EventHandle)) return 1;
   
   //******************************************************************
   // Common config for Pilot and RIO
   //******************************************************************
   // This config will be set up once and never changed.  Settings are for both Pilot and RIO.

   //******************************************************************
   //    Setup some basic settings
  
   //SetKBLayout(KB_ENG);            // this file designed for English keyboard.
   SetShiftButton(&Joystick, S3, &Throttle, 0, 0, 0);        // IO Shift and UMD Setup   

   //******************************************************************
   //    Map DirectX axis

   // JoyX, JoyY
  MapAxis(&Joystick, JOYX, DX_X_AXIS, AXIS_NORMAL, MAP_ABSOLUTE);
  MapAxis(&Joystick, JOYY, DX_Y_AXIS, AXIS_NORMAL, MAP_ABSOLUTE);
   
   // Throttle - Left and Right
  MapAxis(&Throttle, THR_RIGHT, DX_Z_AXIS, AXIS_NORMAL, MAP_ABSOLUTE);
  MapAxis(&Throttle, THR_LEFT, DX_ZROT_AXIS, AXIS_NORMAL, MAP_ABSOLUTE);
   
   // Slew Control
   //MapAxis(&Throttle, SCX, DX_XROT_AXIS, AXIS_NORMAL, MAP_ABSOLUTE);
   //MapAxis(&Throttle, SCY, DX_YROT_AXIS, AXIS_NORMAL, MAP_ABSOLUTE);

   // Throttle Friction Control
   MapAxis(&Throttle, THR_FC, DX_SLIDER_AXIS, AXIS_NORMAL, MAP_ABSOLUTE);
   
   //******************************************************************
   //    Throttle Controls

   // Coolie Switch (HAT)
   MapKeyIO(&Throttle, CSU, 0, DCS_ZoomInSlow);
   MapKeyIO(&Throttle, CSD, 0, DCS_ZoomOutSlow);    
   MapKeyIO(&Throttle, CSL, 0, DCS_LabelsAll);
   MapKeyIO(&Throttle, CSR, 0, DCS_ZoomNormal);
   
   printf("----------------------------------\xa");

   SetUpFA18();            // Configure FA18 specific mappings.  (Default to FA18 config on startup)
}    // end main()
   

int SetUpFA18()
{
   printf("Setting up config for FA18...\xa");

   // Swap to F16config when shifted Left Throttle Button pressed
   MapKey(&Throttle, LTB, EXEC("SetUpF16();"));
   
   //  ...
   MapKey(&Joystick, H4U, DCS_1_Macro_1); // a -letter
   MapKey(&Joystick, H3U, DCS_1_Macro_2); // b -letter
   
}

int SetUpF16()
{
   printf("Setting up config for F16...\xa");

   // Swap to FA18 config when shifted Left Throttle Button pressed
   MapKey(&Throttle, LTB, EXEC("SetUpFA18();"));
   
   // Place all RIO specific configs here
   // This can include all normal config commands like MapKey, MapAxis, etc
   //  ...
   MapKey(&Joystick, H4U, DCS_2_Macro_1); // c -letter
   MapKey(&Joystick, H3U, DCS_2_Macro_2); // d -letter
   //MapKey(&Joystick, H3U, 0); // if this zero is used instead of macro etc it blocks everything (weird)
   
}

//******************************************************************
int EventHandle(int type, alias o, int x)
{
   DefaultMapping(&o, x);
}
//******************************************************************

 

[sIGPIC][/sIGPIC]

HP Z420 | Xeon E5-1650 @3.20GHz/3.70Ghz | 16Gb DDR3-1333 | ZOTAC GTX 980 Ti AMP! | Micron RealSSD C400 256Gb | Sound Blaster Z | TrackIR4 | Thrustmaster HOTAS Warthog| CH Pro pedals | Win 10 Pro 64-bit

 

Link to comment
Share on other sites

Finally I understood :doh: that all these blocks see each other (of course) and thats why after switch I get other profile buttons if they are not reprogrammed at second profile.

 

Weird thing is that if you try to block other profile buttons with "0" then it get stuck. That's small problem if you don't want to use that button in other profile...is there other way around?

 

Here is my last working test code

 

// ==========================================================

include "target.tmh"
include "DCS_Default.ttm"
include "DCS_1.ttm"
include "DCS_2.ttm"

int main()
{

   // Configure exlude list
   Configure(&T16000,MODE_EXCLUDED);
   Configure(&T16000L,MODE_EXCLUDED);
   Configure(&TWCSThrottle,MODE_EXCLUDED);
   Configure(&HCougar,MODE_EXCLUDED);
   Configure(&LMFD,MODE_EXCLUDED); 
   Configure(&RMFD,MODE_EXCLUDED);
   Configure(&TFRPRudder,MODE_EXCLUDED);
   Configure(&TFRPHARudder,MODE_EXCLUDED);
   //Configure(&Throttle,MODE_EXCLUDED);
   
  if(Init(&EventHandle)) return 1;
   
   //******************************************************************
   // Common config for Pilot and RIO
   //******************************************************************
   // This config will be set up once and never changed.  Settings are for both Pilot and RIO.

   //******************************************************************
   //    Setup some basic settings
  
   //SetKBLayout(KB_ENG);            // this file designed for English keyboard.
   SetShiftButton(&Joystick, S3, &Throttle, 0, 0, 0);        // IO Shift and UMD Setup   

   //******************************************************************
   //    Map DirectX axis

   // JoyX, JoyY
  MapAxis(&Joystick, JOYX, DX_X_AXIS, AXIS_NORMAL, MAP_ABSOLUTE);
  MapAxis(&Joystick, JOYY, DX_Y_AXIS, AXIS_NORMAL, MAP_ABSOLUTE);
   
   // Throttle - Left and Right
  MapAxis(&Throttle, THR_RIGHT, DX_Z_AXIS, AXIS_NORMAL, MAP_ABSOLUTE);
  MapAxis(&Throttle, THR_LEFT, DX_ZROT_AXIS, AXIS_NORMAL, MAP_ABSOLUTE);
   
   // Slew Control
   //MapAxis(&Throttle, SCX, DX_XROT_AXIS, AXIS_NORMAL, MAP_ABSOLUTE);
   //MapAxis(&Throttle, SCY, DX_YROT_AXIS, AXIS_NORMAL, MAP_ABSOLUTE);

   // Throttle Friction Control
   MapAxis(&Throttle, THR_FC, DX_SLIDER_AXIS, AXIS_NORMAL, MAP_ABSOLUTE);
   
   //******************************************************************
   //    Throttle Controls

   // Coolie Switch (HAT)
   MapKeyIO(&Throttle, CSU, 0, DCS_ZoomInSlow);
   MapKeyIO(&Throttle, CSD, 0, DCS_ZoomOutSlow);    
   MapKeyIO(&Throttle, CSL, 0, DCS_LabelsAll);
   MapKeyIO(&Throttle, CSR, 0, DCS_ZoomNormal);
   
   printf("----------------------------------\xa");

   SetUpFA18();            // Configure FA18 specific mappings.  (Default to FA18 config on startup)
}    // end main()
   

int SetUpFA18()
{
   printf("Setting up config for FA18...\xa");

   // Swap to F16config when shifted Left Throttle Button pressed
   MapKey(&Throttle, LTB, EXEC("SetUpF16();"));
   
   //  ...
   MapKey(&Joystick, H4U, DCS_1_Macro_1); // a -letter
   MapKey(&Joystick, H3U, DCS_1_Macro_2); // b -letter
   
}

int SetUpF16()
{
   printf("Setting up config for F16...\xa");

   // Swap to FA18 config when shifted Left Throttle Button pressed
   MapKey(&Throttle, LTB, EXEC("SetUpFA18();"));
   
   // Place all RIO specific configs here
   // This can include all normal config commands like MapKey, MapAxis, etc
   //  ...
   MapKey(&Joystick, H4U, DCS_2_Macro_1); // c -letter
   MapKey(&Joystick, H3U, DCS_2_Macro_2); // d -letter
   //MapKey(&Joystick, H3U, 0); // if this zero is used instead of macro etc it blocks everything (weird)
   
}

//******************************************************************
int EventHandle(int type, alias o, int x)
{
   DefaultMapping(&o, x);
}
//******************************************************************

 

map it to a dx button that isn't going to be used...

SYSTEM SPECS: Hardware Intel Corei7-12700KF @ 5.1/5.3p & 3.8e GHz, 64Gb RAM, 4090 FE, Dell S2716DG, Virpil T50CM3 Throttle, WinWIng Orion 2 & F-16EX + MFG Crosswinds V2, Varjo Aero
SOFTWARE: Microsoft Windows 11, VoiceAttack & VAICOM PRO

1569924735_WildcardsBadgerFAASig.jpg.dbb8c2a337e37c2bfb12855f86d70fd5.jpg

Link to comment
Share on other sites

T-Rudder is normal for TFRPRudder as far as I know.

 

I have one of these and its always been reported that way.

 

dmonds

 

Yes..I know..but was wondering..why name is that...wondering starts because I didn't manage to block that rudder from TM combined..but that was not problem of wrong excluded list but from wrong place of exclude list..and that's why I started to wonder that name thing..cause I thought that target finds my rudder with wrong name...

 

But now everything is ok..except that you can't use 0 at empty button...

 

[sIGPIC][/sIGPIC]

HP Z420 | Xeon E5-1650 @3.20GHz/3.70Ghz | 16Gb DDR3-1333 | ZOTAC GTX 980 Ti AMP! | Micron RealSSD C400 256Gb | Sound Blaster Z | TrackIR4 | Thrustmaster HOTAS Warthog| CH Pro pedals | Win 10 Pro 64-bit

 

Link to comment
Share on other sites

So you think that 0 should be work..I know that my tmh is original...I just installed latest software cause I realize that there was some update to my rudder and stick.

 

[sIGPIC][/sIGPIC]

HP Z420 | Xeon E5-1650 @3.20GHz/3.70Ghz | 16Gb DDR3-1333 | ZOTAC GTX 980 Ti AMP! | Micron RealSSD C400 256Gb | Sound Blaster Z | TrackIR4 | Thrustmaster HOTAS Warthog| CH Pro pedals | Win 10 Pro 64-bit

 

Link to comment
Share on other sites

Weird thing is that if you try to block other profile buttons with "0" then it get stuck. That's small problem if you don't want to use that button in other profile...is there other way around?

 

Using a 0 to block (or set to nothing) a MapKey command for one profile to over ride the setting in the other profile should work. I just took your code and ran it and it worked fine. Since I didn't have your Macro files, I changed the Macros to quoted characters such as 'a' (and also commented out the View commands on the Throttle Hat), but that makes no difference.

 

Below is the code I ran. I have no idea why it didn't work for you unless there is something special or weird about the macros you defined. Try my code below exactly as typed and see if it works.

 

// ==========================================================

include "target.tmh"
//include "DCS_Default.ttm"
//include "DCS_1.ttm"
//include "DCS_2.ttm"

int main()
{

   // Configure exlude list
   Configure(&T16000,MODE_EXCLUDED);
   Configure(&T16000L,MODE_EXCLUDED);
   Configure(&TWCSThrottle,MODE_EXCLUDED);
   Configure(&HCougar,MODE_EXCLUDED);
   Configure(&LMFD,MODE_EXCLUDED); 
   Configure(&RMFD,MODE_EXCLUDED);
   Configure(&TFRPRudder,MODE_EXCLUDED);
   Configure(&TFRPHARudder,MODE_EXCLUDED);
   //Configure(&Throttle,MODE_EXCLUDED);
   
  if(Init(&EventHandle)) return 1;
   
   //******************************************************************
   // Common config for Pilot and RIO
   //******************************************************************
   // This config will be set up once and never changed.  Settings are for both Pilot and RIO.

   //******************************************************************
   //    Setup some basic settings
  
   //SetKBLayout(KB_ENG);            // this file designed for English keyboard.
   SetShiftButton(&Joystick, S3, &Throttle, 0, 0, 0);        // IO Shift and UMD Setup   

   //******************************************************************
   //    Map DirectX axis

   // JoyX, JoyY
  MapAxis(&Joystick, JOYX, DX_X_AXIS, AXIS_NORMAL, MAP_ABSOLUTE);
  MapAxis(&Joystick, JOYY, DX_Y_AXIS, AXIS_NORMAL, MAP_ABSOLUTE);
   
   // Throttle - Left and Right
  MapAxis(&Throttle, THR_RIGHT, DX_Z_AXIS, AXIS_NORMAL, MAP_ABSOLUTE);
  MapAxis(&Throttle, THR_LEFT, DX_ZROT_AXIS, AXIS_NORMAL, MAP_ABSOLUTE);
   
   // Slew Control
   //MapAxis(&Throttle, SCX, DX_XROT_AXIS, AXIS_NORMAL, MAP_ABSOLUTE);
   //MapAxis(&Throttle, SCY, DX_YROT_AXIS, AXIS_NORMAL, MAP_ABSOLUTE);

   // Throttle Friction Control
   MapAxis(&Throttle, THR_FC, DX_SLIDER_AXIS, AXIS_NORMAL, MAP_ABSOLUTE);
   
   //******************************************************************
   //    Throttle Controls

   // Coolie Switch (HAT)
   //MapKeyIO(&Throttle, CSU, 0, DCS_ZoomInSlow);
   //MapKeyIO(&Throttle, CSD, 0, DCS_ZoomOutSlow);    
   //MapKeyIO(&Throttle, CSL, 0, DCS_LabelsAll);
   //MapKeyIO(&Throttle, CSR, 0, DCS_ZoomNormal);
   
   printf("----------------------------------\xa");

   SetUpFA18();            // Configure FA18 specific mappings.  (Default to FA18 config on startup)
}    // end main()
   

int SetUpFA18()
{
   printf("Setting up config for FA18...\xa");

   // Swap to F16config when shifted Left Throttle Button pressed
   MapKey(&Throttle, LTB, EXEC("SetUpF16();"));
   
   //  ...
   MapKey(&Joystick, H4U, 'a'); // a -letter
   MapKey(&Joystick, H3U, 'b'); // b -letter
   
}

int SetUpF16()
{
   printf("Setting up config for F16...\xa");

   // Swap to FA18 config when shifted Left Throttle Button pressed
   MapKey(&Throttle, LTB, EXEC("SetUpFA18();"));
   
   // Place all RIO specific configs here
   // This can include all normal config commands like MapKey, MapAxis, etc
   //  ...
   MapKey(&Joystick, H4U, 'c'); // c -letter
   //MapKey(&Joystick, H3U, 'd'); // d -letter
   MapKey(&Joystick, H3U, 0); // if this zero is used instead of macro etc it blocks everything (weird)
   
}

//******************************************************************
int EventHandle(int type, alias o, int x)
{
   DefaultMapping(&o, x);
}
//******************************************************************

 

Some further info:

 

TARGET doesn't care if you map it to 'a' or 0, they are just numbers and it doesn't care what the number is. For example, 'a' is 97 (97 is the ASCII code for a lower case a). Well, yes, 0 is special in that a 0 does nothing (does not press a key because this is an ASCII NULL, or non-character), but it is all stored and handled the same way by MapKey() and TARGET. Perhaps more important to realize is, all mappings start out as 0, so if you remap something back to 0, you are just making it like it was when you first started.

 

I believe the example you started from came from an earlier post on this thread. In fact, a lot of little details about your code are pulled directly from my own common DCS script template, but the profile swapping method used in your code was created by someone else (I forget who, but he is a regular here as well).

 

My own profile swapping script has morphed into a much more complex example. If you are curious, check the link below. It is for Train Sim World, which I'm sure nobody here cares about, but half the reason I did my TSW script was to demonstrate some of the more advanced topics like profile swapping. There is a decent amount of documentation included with the download. It swaps between 28 different locomotives, using the THR_FC lever, or two buttons to swap profiles. It also has LED and audible feedback (beeps and verbal feedback) to let you know what profile you have chosen.

 

https://forums.dovetailgames.com/threads/thurstmaster-target-script-for-warthog-throttle-saitek-tq-profile.3634/

 

In my script, I have a single function called CommonConfig() which sets all the common configuration for all profiles. Then I call a specific config function that sets up things specific to a single profile. This is because there is no way to call any of the configuration in main() a second time, so I moved most the original setup to CommonConfig(). When I change profiles, I always call CommonConfig() again to reset everything back to the common setup, and then call the custom function for the new selected profile. This helps provide some consistency and reduces possible conflicts.

 

Not sure if any of that helps, except to say that what you did should work.

Link to comment
Share on other sites

  • 2 weeks later...

Is there a way of getting the S3 button to act a Shiftbutton but only on longpress ...

 

I tried

MapKey(&Joystick,S3,TEMPO(DX5,DX100));	
SetShiftButton(&Joystick,DX100,&Throttle,PSF,PSB );
MapKeyIO(&Joystick,S1,DX101,DX102)

 

but that doesn't seem to work, as it always seems to give me 102. it doesn't seem to register that DX100 is in use as a switch (though it correctly detects its use as a button)

SYSTEM SPECS: Hardware Intel Corei7-12700KF @ 5.1/5.3p & 3.8e GHz, 64Gb RAM, 4090 FE, Dell S2716DG, Virpil T50CM3 Throttle, WinWIng Orion 2 & F-16EX + MFG Crosswinds V2, Varjo Aero
SOFTWARE: Microsoft Windows 11, VoiceAttack & VAICOM PRO

1569924735_WildcardsBadgerFAASig.jpg.dbb8c2a337e37c2bfb12855f86d70fd5.jpg

Link to comment
Share on other sites

ah this seems to work

 

		MapKey(&Joystick,S3,TEMPO(DX5,DX100));	
	SetShiftButton(&Joystick,S3);
               MapKeyIO(&Joystick,S1,DX101,DX102)

 

though i confess.. i don't think it should...:doh:


Edited by speed-of-heat

SYSTEM SPECS: Hardware Intel Corei7-12700KF @ 5.1/5.3p & 3.8e GHz, 64Gb RAM, 4090 FE, Dell S2716DG, Virpil T50CM3 Throttle, WinWIng Orion 2 & F-16EX + MFG Crosswinds V2, Varjo Aero
SOFTWARE: Microsoft Windows 11, VoiceAttack & VAICOM PRO

1569924735_WildcardsBadgerFAASig.jpg.dbb8c2a337e37c2bfb12855f86d70fd5.jpg

Link to comment
Share on other sites

ah this seems to work

 

        MapKey(&Joystick,S3,TEMPO(DX5,DX100));    
       SetShiftButton(&Joystick,S3);
                MapKeyIO(&Joystick,S1,DX101,DX102)

though i confess.. i don't think it should...:doh:

 

 

Post your .tmc, please. I'd like to see what you did in context. I don't think it should work either, but if it does...

Night Ops in the Harrier

IYAOYAS


 
Link to comment
Share on other sites

You forgot to define timing in the tempo code.

 

MapKey(&Joystick,S3,TEMPO(DX5,DX100, 500)); // for 500 ms

 

That’s optional...

SYSTEM SPECS: Hardware Intel Corei7-12700KF @ 5.1/5.3p & 3.8e GHz, 64Gb RAM, 4090 FE, Dell S2716DG, Virpil T50CM3 Throttle, WinWIng Orion 2 & F-16EX + MFG Crosswinds V2, Varjo Aero
SOFTWARE: Microsoft Windows 11, VoiceAttack & VAICOM PRO

1569924735_WildcardsBadgerFAASig.jpg.dbb8c2a337e37c2bfb12855f86d70fd5.jpg

Link to comment
Share on other sites

Post your .tmc, please. I'd like to see what you did in context. I don't think it should work either, but if it does...

 

Will do!

SYSTEM SPECS: Hardware Intel Corei7-12700KF @ 5.1/5.3p & 3.8e GHz, 64Gb RAM, 4090 FE, Dell S2716DG, Virpil T50CM3 Throttle, WinWIng Orion 2 & F-16EX + MFG Crosswinds V2, Varjo Aero
SOFTWARE: Microsoft Windows 11, VoiceAttack & VAICOM PRO

1569924735_WildcardsBadgerFAASig.jpg.dbb8c2a337e37c2bfb12855f86d70fd5.jpg

Link to comment
Share on other sites

Post your .tmc, please. I'd like to see what you did in context. I don't think it should work either, but if it does...

 

this is what i have working, my context was i wanted mouse buttons in VR without having to give up the S3 button, and it works sort of, what i forgot, was the F-18 has a long press for NWS built in, which means i will likely move the switch to a different button but concept works :

 

include "targetdx128.tmh"

//program startup
int main()
{	
//Exclude unused devices 
	Configure(&HCougar, MODE_EXCLUDED);
	Configure(&T16000, MODE_EXCLUDED);
	Configure(&T16000L, MODE_EXCLUDED);
	Configure(&LMFD, MODE_EXCLUDED);
	Configure(&RMFD, MODE_EXCLUDED);
	Configure(&TFRPRudder, MODE_EXCLUDED);
	Configure(&TWCSThrottle, MODE_EXCLUDED);
	Configure(&TFRPRudder, MODE_EXCLUDED);
			
//Turn off automatic Joystick and Throttle disabling
Configure(&Throttle, MODE_KEEPENABLED);
Configure(&Joystick, MODE_KEEPENABLED); 

//Turn off LED's on Throttle 
	ActKey(PULSE+KEYON+LED(&Throttle, LED_INTENSITY, 0));

if(Init(&EventHandle)) return 1; // declare the event handler, return on error

/////////////////////////////	
//	**  INITIAL CONFIG  ** //
/////////////////////////////

	SetKBRate(50, 50);
	SetKBLayout(KB_ENG);
	SetShiftButton(0, 0, 0, 0, 0, 0);

	
/////////////////////////////	
//	** AXIS DEFINITIONS ** //
/////////////////////////////

//	JOYSTICK //
	MapAxis(&Joystick,JOYX,DX_X_AXIS); 
	MapAxis(&Joystick,JOYY,DX_Y_AXIS); 


// TDC AXIS //
	MapAxis(&Throttle, SCX, DX_XROT_AXIS, AXIS_NORMAL, MAP_ABSOLUTE);
	SetSCurve(&Throttle, SCX, 0, 0, 0, 0, 0);
	MapAxis(&Throttle, SCY, DX_YROT_AXIS, AXIS_REVERSED, MAP_ABSOLUTE);
	SetSCurve(&Throttle, SCY, 0, 0, 0, 0, 0);
	
// TDC Re-map for A2G Modes this adds a TDC depress Key to the existing Axis movements // 
	//Y-Axis//
//	KeyAxis(&Throttle, SCY, 'id', AXMAP1(2, DX25, DX25)); // This is a test bit of code it might not work as intended which is to add TDC Depress option 
//	KeyAxis(&Throttle, SCY, 'od', AXMAP1(2, DX25, DX25)); // when I select an Air to Ground Mode which is mapped to my boat switch
	
	//X-Axis//
//	KeyAxis(&Throttle, SCX, 'id', AXMAP1(2, DX25, DX25)); // As SCY
//	KeyAxis(&Throttle, SCX, 'od', AXMAP1(2, DX25, DX25)); // As SCY
	
// THROTTLE AXIS //		
	MapAxis(&Throttle, THR_RIGHT, DX_Z_AXIS, AXIS_NORMAL, MAP_ABSOLUTE);
	SetSCurve(&Throttle, THR_RIGHT, 0, 0, 0, 0, 0);
	
	MapAxis(&Throttle, THR_LEFT, DX_ZROT_AXIS, AXIS_NORMAL, MAP_ABSOLUTE);
	SetSCurve(&Throttle, THR_LEFT, 0, 0, 0, 0, 0);

// THROTTLE FRICTION LEVER //	
	// MapAxis(&Throttle, THR_FC, DX_SLIDER_AXIS, AXIS_NORMAL, MAP_ABSOLUTE);
	// SetSCurve(&Throttle, THR_FC, 0, 0, 0, 0, 0);
	KeyAxis(&Throttle, THR_FC, 0 , AXMAP2 (3, DX77 ,DX76, PULSE+DX75)); // DX75 Default View, DX76 Zoom UI, DX77 SpyGlass
	// KeyAxis(&Throttle, THR_FC, 0 , AXMAP1 (2, DX77, PULSE+DX75, DX76)); // DX75 Zoom in, DX76 Default FOV, DX77 Zoom Out
	// KeyAxis(&Throttle,THR_FC,0,AXMAP2(LIST(0,40,60,100),DX75,0,DX77));

// T-RUDDER AXES //	
// To Many Axes
//	MapAxis(&TFRPRudder, TRPRIGHT, DX_XROT_AXIS, AXIS_NORMAL, MAP_ABSOLUTE);
//	SetSCurve(&TFRPRudder, TRPRIGHT, 0, 0, 0, 0, 0);
//	MapAxis(&TFRPRudder, TRUDDER, DX_Z_AXIS, AXIS_NORMAL, MAP_ABSOLUTE);
//	SetSCurve(&TFRPRudder, TRUDDER, 0, 0, 0, 0, 0);
//	MapAxis(&TFRPRudder, TRPLEFT, DX_YROT_AXIS, AXIS_NORMAL, MAP_ABSOLUTE);
//	SetSCurve(&TFRPRudder, TRPLEFT, 0, 0, 0, 0, 0);


/////////////////////////////	
//	** JOYSTICK BUTTONS ** //
/////////////////////////////


// GUN TRIGGER 1 & 2 //	
	MapKey(&Joystick,TG1,DX1);
	MapKey(&Joystick,TG2,DX2);


// NWS //
	MapKey(&Joystick,S3,DX5);	
        MapKey(&Joystick,S3,TEMPO(DX5,DX100));	
// SetShiftButton(&Joystick,S3);

// MASTER MODE //	
//	MapKey(&Joystick,S1,DX3); 	
//	MapKey(&Joystick,S1,CHAIN( EXEC("DXAxis(MOUSE_X_AXIS, -14100);" "DXAxis(MOUSE_Y_AXIS, 13000);"),PULSE+MOUSE_LEFT)); // MAPS MASTER MODE as LMB Press slightly below line of vision (Odyessy Plus)
//	MapKey(&Joystick,S1,CHAIN( EXEC("DXAxis(MOUSE_X_AXIS, -14000);" "DXAxis(MOUSE_Y_AXIS, 25000);"), MOUSE_LEFT)); // MAPS MASTER MODE as LMB Press slightly below line of vision (HP Reverb in full screen)
	MapKeyIO(&Joystick,S1,CHAIN( EXEC("DXAxis(MOUSE_X_AXIS, -14000);" "DXAxis(MOUSE_Y_AXIS, 25000);"), MOUSE_RIGHT),CHAIN( EXEC("DXAxis(MOUSE_X_AXIS, -14000);" "DXAxis(MOUSE_Y_AXIS, 25000);"), MOUSE_LEFT)); // MAPS MASTER MODE as LMB Press slightly below line of vision. right button with a longpress of s3 (HP Reverb in full screen)
//	MapKeyIO(&Joystick,S1, MOUSE_RIGHT, MOUSE_LEFT); // MAPS MASTER MODE as LMB Press slightly below line of vision. right button with a longpress of s3 (HP Reverb in full screen)

// WEAPON RELEASE //
	MapKey(&Joystick,S2,DX4); 


// PADDLE //	
	MapKey(&Joystick,S4,DX6);	

// TRIM HAT //
	MapKey(&Joystick,H1U,DXHATUP);    
	MapKey(&Joystick,H1D,DXHATDOWN);
	MapKey(&Joystick,H1L,DXHATLEFT);
	MapKey(&Joystick,H1R,DXHATRIGHT);

// TMS //
	MapKeyIO(&Joystick,H2U,	AXIS(MOUSE_Z_AXIS,   1,	75),DX11); // MOUSE SCROLL UP/ DX11
	MapKeyIO(&Joystick,H2D, AXIS(MOUSE_Z_AXIS,  -1,	75),DX12); // MOUSE SCROLL DOWN/ DX12
	MapKey(&Joystick,H2L,DX13);
	MapKey(&Joystick,H2R,DX14);
				
// DMS //
	MapKey(&Joystick,H3U,DX15);	
	MapKey(&Joystick,H3D,DX16);
	MapKey(&Joystick,H3L,DX17);
	MapKey(&Joystick,H3R,DX18);

// CMS //
	MapKey(&Joystick,H4U,DX19);	
	MapKey(&Joystick,H4D,DX20);
	MapKey(&Joystick,H4L,DX21);
	MapKey(&Joystick,H4R,DX22);
	MapKey(&Joystick,H4P,DX23);


/////////////////////////////	
//	** THROTTLE BUTTONS ** //
/////////////////////////////
	

// TDC DEPRESS //
	MapKey(&Throttle, SC, DX25);

// MIC SWITCH //	
	MapKey(&Throttle, MSP, DX26);
	MapKey(&Throttle, MSU, DX27);
	MapKey(&Throttle, MSR, DX28);
	MapKey(&Throttle, MSD, DX29);
	MapKey(&Throttle, MSL, DX30);
	
// SPEEDBRAKE //	
	MapKey(&Throttle, SPDF, DX31);
	MapKey(&Throttle, SPDM, PULSE+DX32);
	MapKey(&Throttle, SPDB, DX33);

// COOLIE SWITCH //
	MapKey(&Throttle, CSU, DX34);
	MapKey(&Throttle, CSD, DX35);
	MapKey(&Throttle, CSR, DX36);
	MapKey(&Throttle, CSR, DX37); 
	MapKey(&Throttle, CSL, DX38);
	
   
// BOATSWITCH (AKA Mode Switch)//
	
	MapKey(&Throttle, BSF, PULSE+DX39);
	MapKeyR(&Throttle, BSF, PULSE+DX39);
	MapKey(&Throttle, BSM, PULSE+DX40);
	MapKey(&Throttle, BSB, PULSE+DX41);
	MapKeyR(&Throttle, BSB, PULSE+DX41);
	

// CHINA HAT //	
	MapKey(&Throttle, CHF, DX42);
	MapKey(&Throttle, CHM, PULSE+DX43);
	MapKey(&Throttle, CHB, DX44);

// PNKY SWITCH //
	MapKey(&Throttle, PSF, PULSE+DX45);
	MapKey(&Throttle, PSM, PULSE+DX46);
	MapKey(&Throttle, PSB, PULSE+DX47);
	
// LEFT THROTTLE BUTTON //
	MapKey(&Throttle, LTB, 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 //
	MapKey(&Throttle, APUON, PULSE+DX57);
	MapKey(&Throttle, APUOFF, 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 //
	MapKey(&Throttle, APPAT, PULSE+DX68); // Autopilot Path //
	MapKey(&Throttle, APAH, PULSE+DX69);	// Autopilot Alt/Hdg //
	MapKey(&Throttle, APALT, 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);
			
	
}

//event handler
int EventHandle(int type, alias o, int x)
{
   DefaultMapping(&o, x);

//add event handling code here


SYSTEM SPECS: Hardware Intel Corei7-12700KF @ 5.1/5.3p & 3.8e GHz, 64Gb RAM, 4090 FE, Dell S2716DG, Virpil T50CM3 Throttle, WinWIng Orion 2 & F-16EX + MFG Crosswinds V2, Varjo Aero
SOFTWARE: Microsoft Windows 11, VoiceAttack & VAICOM PRO

1569924735_WildcardsBadgerFAASig.jpg.dbb8c2a337e37c2bfb12855f86d70fd5.jpg

Link to comment
Share on other sites

speed-of-heat I can see the aparent usefullness of what you are trying to do. But keep in mind that you can still program keypresses/inputs to your shift or UMD. So if you program a momentary inputto your shift button, it will basicaly still do what you want, granted depending on what you are trying to do, there may be some situations where that shift still activating momentarily may be undesirable, but I've used it and it works fine for my aplications.

 

(hadn't seen your code yet when I posted)

Link to comment
Share on other sites

  • Recently Browsing   0 members

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