Jump to content

TARGET GUI - Long Press


Recommended Posts

I have been asked about how to obtain a Long press from TARGET GUI. So, I opened this thread to display screenshots showing how to do that.

 

I chose TG1 here and this is what "View Script" button shows :

MapKey(&Joystick, TG1, CHAIN( DOWN+'t', D(1000), UP+'t'));

 

This correspond to 3 chained events:

1/3 - Press the T key,

2/3 - hold it for 1000 ms (1sec)

3/3 - Release T key

 

And here is the build sequence:

[TABLE]Select a throttle or joystick button |
TG1

Give it an
Event Name
|
T Long Press 1/2 (Press)

Select a
Key Command
|
t

Choose event
Type
|
Press

Leave
Delay
|
Default

Leave
Sequence
|
unchecked

Hit
Add Event
|

|

Change
Event Name
|
T Long Press 2/2 (Hold and Release)

Select the same
Key Command
|
t

Choose event
Type
|
Release

Insert an HOLD
Delay
|
1000

Leave
Sequence
|
unchecked

Hit
Add Event
| ...done

 

[/TABLE]

 

EventTester shows the exact same virtual keyboard event is generated for a very short (100ms) TG1 button click (the first 2 lines) or while holding TG1 for several seconds.

TARGET_GUI_Long_Press_1.jpg.581880e9f25c18a0934640a133adbb6d.jpg

TARGET_GUI_Long_Press_2.jpg.1a7dea60b2ae9e70ccc432e83b199f3c.jpg

TARGET_GUI_Long_Press_3.jpg.495fd2262cd6384d81d43c1d188a4228.jpg

TARGET_GUI_Long_Press_4.jpg.35d40c383e1e2e157c9c4417f737448d.jpg


Edited by ivanwfr
added EventTester screenshot
Link to comment
Share on other sites

Hi Ivan,

 

Thanks for your help but I couldn't get it to work.

I want to use the paddle on the TM Warthog control stick to activate wheel brake when held (W) or activate Parking Brake when tapped (LShift W).

I've tried every combination with no luck.

Any ideas?

 

Thanks,

Toby

Ryzen 5800X, 32GB RAM, RTX 3060

 

Link to comment
Share on other sites

Well, from my point of view, I'm tempted to say that this is what you get when you want to keep it easy.

 

TARGET GUI is there only because most users don't want to take the time to learn how to use the Script Editor. And you've just reached the limit where you are about to understand what you can get in return.

 

What you' re asking would be one line for the Script editor:

  • MapKey(&Joystick, S4, TEMPO('w'+L_SHIFT , 'w' , 300));

 

For DCS A-10C which has no parking brake, TARGET can even compensate quite easily by holding the key for you: A short press would toggle 'w' press and release in a sequence.

- One SHORT press would set it on, the next off.

- The LONG press would kick in after a delay of 300ms (meaning it's not the SHORT kind) and would hold 'w' down until you release the switch as if it were an ordinary w key.

  • MapKey(&Joystick, S4, TEMPO(SEQ(DOWN+'w' , UP+'w') , 'w' , 300));

 

When you know how to use the script editor, the difficulty becomes to try to get the same result from the GUI. The issue is either a nightmare or plain impossible. Difficulties have simply changed sides.

 

Maybe you can try so steal the script from the GUI and simply insert one of those lines near the end.

The result would certainly work fine if you give it to the Script Editor.


Edited by ivanwfr
typos = typos-1
  • Like 1
Link to comment
Share on other sites

Hi Ivan,

I got it working how I wanted.

The Script Editor isn't as scary or as complicated as it first seems.

The first option you mentioned works perfectly.

Now I have a real life brake and parking brake.

Thank you very much for your help.

Ryzen 5800X, 32GB RAM, RTX 3060

 

Link to comment
Share on other sites

  • 4 years later...

  • MapKey(&Joystick, S4, TEMPO('w'+L_SHIFT , 'w' , 300));

 

 

Thank you so much! Just find a answer here and it's works perfect, but after exporting my Target preset to tmc script all switches with HOLD funtion stop working by a some reason...

 

It would be amazing if you can give me advice how can I fix it.

 

Thanks!

Link to comment
Share on other sites

I do not remember quite well after all these years but I suggest you pick something else than the S4 button .. If you have it like me, serving as one of the URDL modifiers, this mapping may be the issue.

 

If this is not the case, I'll have to refresh my memory before I can help further...

Link to comment
Share on other sites

  • 4 years later...

nice solution thanks

Hornet, Super Carrier, Warthog & (II), Mustang, Spitfire, Albatross, Sabre, Combined Arms, FC3, Nevada, Gulf, Normandy, Syria AH-6J

i9 10900K @ 5.0GHz, Gigabyte Z490 Vision G, Cooler Master ML120L, Gigabyte RTX3080 OC Gaming 10Gb, 64GB RAM, Reverb G2 @ 2480x2428, TM Warthog, Saitek pedals & throttle, DIY collective, TrackIR4, Cougar MFDs, vx3276-2k

Combat Wombat's Airfield & Enroute Maps and Planning Tools

 

cw1.png

Link to comment
Share on other sites

Hello

So, using Target UI, is it possible to get two different commands in one button, pressing short and long?

 

Thanks!

 

To my knowledge, no, you could do that with Target Script Editor. Or Joystick Gremlin.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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