So I was using HKTunes as a dedicated global itunes macro application, however I was gifted a new phone and had to update itunes.
Of course, this broke HKTunes, so I had to figure out a solution.
The new itunes works with most media keys globally, but the media volume keys do the global volume, but I need my in game sounds still - so I had to figure out a solution for the volume keys.
iTunes has application specific hotkeys for this, i just had to figure out how to do that from in game without having to alt tab in a tense moment.
I decided to try and figure out if AHK could work for this, and after a couple of hours, I've gotten the following code to work as I needed.
Remember, this is just for the volume keys, as my keyboard allows me to set the macro keys to multimedia defaults - which work for an inactive itunes window now.
Code: Select all
;iTunes Volume Up ---- ---- (Ctrl+Up Arrow Key)
^Up::
DetectHiddenWindows, On ; Tells AHK to search for windows that are minimized/hidden
Target := "ahk_class iTunes"
IfWinNotExist %Target%
{
Return
}
ControlSend, ahk_parent, ^{Up}
return
;iTunes: Volume Down ---- ---- (Ctrl+Down Arrow Key)
^Down::
DetectHiddenWindows, On ; Tells AHK to search for windows that are minimized/hidden
Target := "ahk_class iTunes"
IfWinNotExist %Target%
{
Return
}
ControlSend, ahk_parent, ^{Down}
return
So here you go other noobs, good luck!
And if any pros have some optimizations, that's certainly welcome!