ivanwfr Posted August 18, 2011 Share Posted August 18, 2011 (edited) 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. Edited August 19, 2011 by ivanwfr added EventTester screenshot Link to comment Share on other sites More sharing options...
toby23 Posted August 19, 2011 Share Posted August 19, 2011 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 More sharing options...
ivanwfr Posted August 19, 2011 Author Share Posted August 19, 2011 (edited) 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 August 20, 2011 by ivanwfr typos = typos-1 1 Link to comment Share on other sites More sharing options...
toby23 Posted August 20, 2011 Share Posted August 20, 2011 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 More sharing options...
ivanwfr Posted August 20, 2011 Author Share Posted August 20, 2011 +1 for me then! Script editor still has a hard time to get the attention it deserves ;) I would be happy to help in case you have any new ideas or some issue. Link to comment Share on other sites More sharing options...
SquareBunny Posted January 28, 2016 Share Posted January 28, 2016 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 More sharing options...
ivanwfr Posted January 29, 2016 Author Share Posted January 29, 2016 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 More sharing options...
pabletesoy Posted June 8, 2020 Share Posted June 8, 2020 Hello So, using Target UI, is it possible to get two different commands in one button, pressing short and long? Thanks! Link to comment Share on other sites More sharing options...
shu77 Posted June 8, 2020 Share Posted June 8, 2020 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 Link to comment Share on other sites More sharing options...
Ant0ine Posted June 8, 2020 Share Posted June 8, 2020 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 More sharing options...
Recommended Posts