AutoHotKey, Stream Deck, ROCCAT Power-Grid, etc. - ED Forums
 


Notices

Reply
 
Thread Tools Display Modes
Old 11-13-2019, 01:38 PM   #1
pdmarsh
Member
 
Join Date: Mar 2012
Location: Auburn, PA, USA
Posts: 475
Default AutoHotKey, Stream Deck, ROCCAT Power-Grid, etc.

My search for a way to automate certain repetitive tasks in DCS has led me down a rabbit hole. I also appear to be late to the game as many posts date back years and abruptly end, e.g. with AutoHotKey. Some are no longer usable, e.g. Power-Grid (can't create a necessary account). Some are over my head, e.g. HIDMacros (which is also no longer supported).

I have managed to get AutoHotKey (AHK) working thanks to an old post on DCS. An example of what I want to do, and what works, is this:

RAlt + / (open radio menu)
F5 (select ATC)
F1 (select airport)
F3 (request start-up)

The actual AHK code is below.

The issue I have now is that I will run out of unused keyboard keys (for the hot keys themselves) fairly quickly. Ideally, I would launch a macro with a single key (or button), which is the entire point of the exercise. I would like to find a button box cheaper than Stream Deck, but that will do much of the same thing as the latter by using AHK. However, I can't figure out what joystick identifier to use, or the button number for that matter. In AHK, "1Joy1" would indicate Joystick 1/Button 1. This does not work for me, so I'm guessing I need to use a different identifier for the joysticks I use. If I can figure this out, I can then look at other input devices, but for now I'm testing with the joysticks.

If anyone has experience with this, I would appreciate any direction you can provide. If there is another approach to accomplish this, I'd love to hear about that as well.

Thanks,
Paul

Code:
#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn  ; Enable warnings to assist with detecting common errors.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.

~3::  ;Request Engine Start
Send {RAlt down}\{RAlt up}
Sleep, 500
Send {F5 down}{F5 up}
Sleep, 500
Send {F1 down}{F1 up}
Sleep, 500
Send {F3 down}{F3 up}
return

~4::  ;Request Taxi
Send {RAlt down}\{RAlt up}
Sleep, 500
Send {F5 down}{F5 up}
Sleep, 500
Send {F1 down}{F1 up}
Sleep, 500
Send {F1 down}{F1 up}
return

~5::  ;Request Takeoff
Send {RAlt down}\{RAlt up}
Sleep, 500
Send {F5 down}{F5 up}
Sleep, 500
Send {F1 down}{F1 up}
Sleep, 500
Send {F1 down}{F1 up}
return

Last edited by pdmarsh; 11-13-2019 at 01:49 PM.
pdmarsh is offline   Reply With Quote
Old 11-14-2019, 10:15 PM   #2
David OC
Senior Member
 
David OC's Avatar
 
Join Date: Jul 2013
Location: Australia
Posts: 2,164
Default

The easy way would be to use the Joystick software and assign the keyboard key to the button that your using with AutoHotKey.

Example
Thrustmaster / T.A.R.G.E.T - Script Editor

Looking at AutoHotKey, it seems you can do it, just a little work.

https://www.autohotkey.com/docs/misc...stick.htm#axis
https://www.autohotkey.com/docs/scri...ystickTest.htm

Remapping a Joystick
https://www.autohotkey.com/docs/misc/RemapJoystick.htm

Slow it down if needed?
Code:
Joy2::
Send {Space down}   ; Press the spacebar down.
SetTimer, WaitForJoy2, 30  ; Reduce the number 30 to 20 or 10 to send keys faster. Increase it to send slower.
return
Full speed

Code:
Joy3::Send a{Esc}{Space}{Enter}  ; Have button #3 send the letter "a" followed by Escape, Space, and Enter.
__________________

i7-7700K OC @ 5Ghz | ASUS IX Hero MB
| ASUS GTX 1080 Ti STRIX | 32GB Corsair 3000Mhz | Corsair H100i V2 Radiator | Samsung 960 EVO M.2 NVMe 500G SSD | Samsung 850 EVO 500G SSD | Corsair HX850i Platinum 850W | Oculus Rift | ASUS PG278Q 27-inch, 2560 x 1440, G-SYNC, 144Hz, 1ms | VKB Gunfighter Pro

Chuck's DCS Tutorial Library

Download PDF Tutorial guides
to help get up to speed with aircraft quickly and also great for taking a good look at the aircraft available for DCS before purchasing. Link



Last edited by David OC; 11-14-2019 at 10:30 PM.
David OC is offline   Reply With Quote
Old 11-15-2019, 08:49 AM   #3
AnarchyZG
Junior Member
 
Join Date: May 2018
Posts: 37
Default

Quote:
Originally Posted by pdmarsh View Post
My search for a way to automate certain repetitive tasks in DCS has led me down a rabbit hole. I also appear to be late to the game as many posts date back years and abruptly end, e.g. with AutoHotKey. Some are no longer usable, e.g. Power-Grid (can't create a necessary account). Some are over my head, e.g. HIDMacros (which is also no longer supported)....
I'd go with MATRIC, it is similar to Power-Grid in functionality.
It is supported, works well with DCS, extremely easy to set up (drag&drop, macro recorder...etc) there are also a number of ready-made configurations ("decks") for DCS in the community gallery, just search "DCS".



AnarchyZG is online now   Reply With Quote
Old 11-15-2019, 12:43 PM   #4
pdmarsh
Member
 
Join Date: Mar 2012
Location: Auburn, PA, USA
Posts: 475
Default

@David OC -- Thank you for the information. I appreciate it very much.

@AnarchyZG -- Thanks for suggesting MATRIC. That's one I had not yet come across. It looks very interesting indeed and I will try it out.

I did figure out one problem I was having with simply testing AHK. For some reason my Logitech Rhino X-56 HOTAS does not show up in Windows 10 as a set of joysticks per se, i.e. the stick and throttle aren't seen as Joystick 1 and Joystick 2. However, they work fine in DCS. I plugged in an older joystick and it does show up as Joystick 3, i.e. a hot key command such as 3Joy1 (joystick 3, button 1) works as it should in AHK and will send a macro command to DCS. For now I'm using the buttons on that stick for some of the macros I want to use, but it's not a permanent solution.

I'll go have a look at MATRIC now.

Thanks again,
Paul
pdmarsh is offline   Reply With Quote
Old 11-15-2019, 12:48 PM   #5
pdmarsh
Member
 
Join Date: Mar 2012
Location: Auburn, PA, USA
Posts: 475
Default

Quote:
Originally Posted by David OC View Post
The easy way would be to use the Joystick software and assign the keyboard key to the button that your using with AutoHotKey.
P.S. David OC -- I wanted to try that, but I can't seem to get the Logitech programming software to install and work on this particular PC. I don't know if it's a Windows 10 issue, a Logitech software issue, or both. I have used the Rhino HOTAS on a Windows 7 PC and have no trouble with the Logitech software there.

Thanks,
Paul
pdmarsh is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT. The time now is 04:17 PM. vBulletin Skin by ForumMonkeys. Powered by vBulletin®.
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.