Jump to content

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


Recommended Posts

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

 

#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


Edited by pdmarsh
Link to comment
Share on other sites

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/RemapJoystick.htm#axis

https://www.autohotkey.com/docs/scripts/JoystickTest.htm

 

Remapping a Joystick

https://www.autohotkey.com/docs/misc/RemapJoystick.htm

 

Slow it down if needed?

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

 

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


Edited by David OC

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

Link to comment
Share on other sites

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".

 

 

 

[sIGPIC][/sIGPIC]

MATRIC developer

Check out MATRIC and forget about keyboard shortcuts

Link to comment
Share on other sites

@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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

  • Recently Browsing   0 members

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