Jump to content

Recommended Posts

Posted

Hey gang,

 

Curious if anyone might can shed some light on an issue I have. I have been learning the Target Script Editor the last couple of days, and have successfully written a profile with it.

 

Only problem I had, was with the numpad + sign.

In the statement, I had it set to generate '+' , however each time when I check it in event viewer, it actually generates a left shift plus +.

Like it might show if generating form the keyboard plus sign rather than the numpad plus sign. I have no L_SHIFT in my statement anywhere.

 

The - key on the numpad seems to work just fine, but scripting for that + key generates a left shift first every time.

 

Anyone else see this? Could it be related to the type of keyboard I am using - Logitech G19?

 

Thanks for any tips - I worked around it by re-assigning the command associated with that key to another key, but am really curious why this is happening.

Don B

EVGA Z390 Dark MB | i9 9900k CPU @ 5.1 GHz | Gigabyte 4090 OC | 64 GB Corsair Vengeance 3200 MHz CL16 | Corsair H150i Pro Cooler |Virpil CM3 Stick w/ Alpha Prime Grip 200mm ext| Virpil CM3 Throttle | VPC Rotor TCS Base w/ Alpha-L Grip| Point Control V2|Varjo Aero|

Posted

Ok I got it gang, apparently for those two keys I had to use USB keycodes rather than the keys themselves.

Don B

EVGA Z390 Dark MB | i9 9900k CPU @ 5.1 GHz | Gigabyte 4090 OC | 64 GB Corsair Vengeance 3200 MHz CL16 | Corsair H150i Pro Cooler |Virpil CM3 Stick w/ Alpha Prime Grip 200mm ext| Virpil CM3 Throttle | VPC Rotor TCS Base w/ Alpha-L Grip| Point Control V2|Varjo Aero|

Posted (edited)

To avoid that issue, but still have scripts that are easy to read, I have a file that I 'include' in every script. It translates easy to read key names into their hex keycodes.

 

This is a piece of that file (attached):

 

define USB_A                   USB[0x04] // [  4] a or A
define USB_B                   USB[0x05] // [  5] b or B
define USB_C                   USB[0x06] // [  6] c or C

 

Then I use the definition name instead of the keycode in my ttm or tmc files, like this:

 

define	Active_Pause	R_SHIFT+USB_PAUSE
define	Clickable_Mouse_Cockpit_Mode_On_Off	L_ALT+USB_C
define	Debriefing_Window	R_SHIFT+USB_QUOTE
define	End_Mission	USB_ESCAPE
define	Frame_Service_Info	R_CTL+USB_PAUSE
define	Respawn	R_CTL+R_SHIFT+USB_TAB

 

Makes life much simpler.

 

EDIT:

To be clearer. This is the include section at the beginning of one of my tmc files. I don't keep all of the files in the same folder. Assuming you kept them all in one folder you would not use the part in RED.

include "target.tmh"
include "[color="red"]\.\.\\Target_Base_Files\\[/color]util_usb.tmh"
include "[color="Red"]\.\.\\DCS_World_All\\[/color]DCS_World_General.ttm"
include "DCS_Huey_Macros_v2.0.ttm"  

util_usb.zip

Edited by cichlidfan

ASUS ROG Maximus VIII Hero, i7-6700K, Noctua NH-D14 Cooler, Crucial 32GB DDR4 2133, Samsung 950 Pro NVMe 256GB, Samsung EVO 250GB & 500GB SSD, 2TB Caviar Black, Zotac GTX 1080 AMP! Extreme 8GB, Corsair HX1000i, Phillips BDM4065UC 40" 4k monitor, VX2258 TouchScreen, TIR 5 w/ProClip, TM Warthog, VKB Gladiator Pro, Saitek X56, et. al., MFG Crosswind Pedals #1199, VolairSim Pit, Rift CV1 :thumbup:

Posted
To avoid that issue, but still have scripts that are easy to read, I have a file that I 'include' in every script. It translates easy to read key names into their hex keycodes.

 

This is a piece of that file (attached):

 

define USB_A                   USB[0x04] // [  4] a or A
define USB_B                   USB[0x05] // [  5] b or B
define USB_C                   USB[0x06] // [  6] c or C

Then I use the definition name instead of the keycode in my ttm or tmc files, like this:

 

define    Active_Pause    R_SHIFT+USB_PAUSE
define    Clickable_Mouse_Cockpit_Mode_On_Off    L_ALT+USB_C
define    Debriefing_Window    R_SHIFT+USB_QUOTE
define    End_Mission    USB_ESCAPE
define    Frame_Service_Info    R_CTL+USB_PAUSE
define    Respawn    R_CTL+R_SHIFT+USB_TAB

Makes life much simpler.

 

EDIT:

To be clearer. This is the include section at the beginning of one of my tmc files. I don't keep all of the files in the same folder. Assuming you kept them all in one folder you would not use the part in RED.

include "target.tmh"
include "[color=red]\.\.\\Target_Base_Files\\[/color]util_usb.tmh"
include "[color=red]\.\.\\DCS_World_All\\[/color]DCS_World_General.ttm"
include "DCS_Huey_Macros_v2.0.ttm"  

 

Thank you so much chichlidfan, I really appreciate your sharing that!

It will definitely help in making these easier to use and read, plus will be handing once I learn to create/use TTM files.

 

Right now I am just adding a comment at the end of each line in my TMC stating what that line does.

Don B

EVGA Z390 Dark MB | i9 9900k CPU @ 5.1 GHz | Gigabyte 4090 OC | 64 GB Corsair Vengeance 3200 MHz CL16 | Corsair H150i Pro Cooler |Virpil CM3 Stick w/ Alpha Prime Grip 200mm ext| Virpil CM3 Throttle | VPC Rotor TCS Base w/ Alpha-L Grip| Point Control V2|Varjo Aero|

  • 3 months later...
Posted

Ok I am back :)

 

I am working on creating a script for Cliffs of Dover, and am trying to create a macro file utilizing also the util_usb.tmh file, and creating macro filenames.

 

So the first thing I did was create macros for firing guns and cannons, assigned to Trigger 1 using the S4 as IO modifier.

 

However, the script seems to be treating the keypress as a pulse command, rather than the key being held. I have a script for another flight sim, however did not use a macro file or the util file, and it treats the keypress as a hold keypress by default. It is my understanding one would have to type pulse in front of the key in order for it to be a pulse command...

 

Here are the contents so far of my script:

include "target.tmh"

include "util_usb.tmh"

include "DonB Cliffs of Dover Macros.ttm"

 

//program startup

int main()

{

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

 

// IL-2 Cliffs of Dover TM Warthog Profile Version 1 by Don B ( Dburne)

//Created for TM Warthog, Track IR 5, Saitek Combat Pedals, CH Throttle Quadrant

// Prop Pitch, Water Rad, Oil Rad on three closest CH sliders. Rudder Trim, Elevator Trim, on last two sliders on left. All assigned in game.

 

 

//add initialization code here

 

SetKBRate(32, 50);

SetKBLayout(KB_ENG);

MapAxis(&Joystick, JOYX, DX_X_AXIS);

MapAxis(&Joystick, JOYY, DX_Y_AXIS);

MapAxis(&Throttle, THR_LEFT, DX_ZROT_AXIS);

MapAxis(&Throttle, THR_RIGHT, DX_Z_AXIS);

MapAxis(&Throttle, SCX, DX_XROT_AXIS);

MapAxis(&Throttle, SCY, DX_YROT_AXIS);

MapAxis(&Throttle, THR_FC, DX_SLIDER_AXIS);

SetShiftButton(&Joystick, S4);

 

 

}

 

//event handler

int EventHandle(int type, alias o, int x)

{

DefaultMapping(&o, x);

 

//add event handling code here

 

MapKeyIO(&Joystick, TG1, Cannon_Fire, Machine_Gun_Fire);

 

 

And the contents of the beginning of my macro file:

// Weapons

 

define Machine_Gun_Fire USB_RETURNORENTER

define Cannon_Fire USB_DELETEORBACKSPACE

 

What am I missing here?

Why is it treating the keypresses as pulses? I need them to be held down until I release the trigger...

 

Thanks for any help!

Don B

EVGA Z390 Dark MB | i9 9900k CPU @ 5.1 GHz | Gigabyte 4090 OC | 64 GB Corsair Vengeance 3200 MHz CL16 | Corsair H150i Pro Cooler |Virpil CM3 Stick w/ Alpha Prime Grip 200mm ext| Virpil CM3 Throttle | VPC Rotor TCS Base w/ Alpha-L Grip| Point Control V2|Varjo Aero|

  • Recently Browsing   0 members

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