You know if you want to use your logitech device (eg Mouse or G13) with AutoHotkey, you need to map your device to a key, which autohotkey then responds to, but you need to work out which keys are not going to interfere, or use modifiers (which causes more problems).
I have the solution!
I worked out how to add keys F13-F24 (Yes, they really do exist as keys, but are basically unused these days) to Logitech Gaming software.
You have AutoHotkey SEND these keys as LGS is in it's bind screen, and then it adds it to the profile and you can have your device send them.
However, you cannot just do like `F1::F24` as LGS just responds to F1, so... you can add a delay.
F1::
Sleep 2000
Send {F24}
return
Bingo.
Unfortunately though, it appears adding F24 as a key to one profile does not make it available in another - adding it to lots of profiles will get laborious, so I wrote a script to do it.
Code: Select all
#NoEnv
#Singleinstance, Force
CoordMode, Mouse, Screen
SetKeyDelay, 50, 50
OKLocated := 0
F1::
MouseGetPos, x1, y1
Loop 12 {
MouseMove, x1, y1
Click
num := A_Index + 12
Sleep 250
Send % "{F" num "}"
if (OKLocated){
MouseClick, Left, x2, y2
} else {
; Wait for user to click OK
KeyWait, LButton, D
KeyWait, LButton
; Record coords
MouseGetPos, x2, y2
OKLocated := 1
}
}
return
It Sends F13, and then waits for you to click OK.
It remembers where you clicked OK, then adds the other 11 bindings automatically
So now you can just do *F24::GoSub, DoSomethingInteresting in your AHK scripts and trigger it with buttons on your device, safe in the knowledge that it should not interfere with anything, and totally independently of the state of any modifiers if desired.