Got a Stream Deck recently. Now I want to integrate my AHKv2-scripts on it.
I heavily rely on AHKv2 and internal system calls (dllcall) for achieving my goals on windows.
Since just calling them is a really boring I want to dynamically change the icons on the stream deck depending e.g. on exit code of the ahk script I try to run.
And no, the StreamDeck UI is not able to provide such functionality by drag&drop. You must write your own plugin to achieve that.
Example goal:
Toggling between Single-/Multi-monitor on a button press (instead of using Win+P) and change the according icon to the current monitor-state.
I started to program a StreamDeck plugin in JavaScript because that is how the SDK for it is documented.
To break the process down, it works like this:
You create a websocket on localhost and send JSON-formatted data back and forth over it to modify the StreamDeck-settings on-the-fly. That is the API to communicate with the Streamdeck control server which handles the (HID-)driver requests.
With the JSON-data you can dynamically change the button's information like which png to display and also to save the settings permanently (e.g. state control)
The problem: I've got the button-logic working in Java-Script but I cannot call the AHK-interpreter from it to execute the neccessary code. So this is a dead end, right?
The .manifest inside the Streamdeck Plugin has a property called "CodePathWin". Executables are supported (currently I've got a .html in there to load the JS code) and if I look into other plugins it is indeed a way to achieve things.
Now I realize that I'd need to program a websocket in AHKv2 and a parser for the .JSON format, just to beeing able to communicate with the damn StreamDeck API. I already googled around and I could only find AHKv1 scripts to achieve those goals.
I neither have the time nor the knowhow to convert that to ahkv2.
Are there already written libraries I could use and couldn't find by googling?
Are there people out there who are (mis-)using their StreamDeck like this? How did you do that?
Please help
![Sad :(](./images/smilies/icon_e_sad.gif)
Sincerly