Although I have been using AutoHotKey a couple of years, I have only used the basics and not really studied the language.
I am curious to know if there is a better (or more idiomatic) way of doing the following (which is working). One concern is that I have to set the state of each keyboard in every else block; it feels clumsy.
Code: Select all
;Default keyboard
keychron := true
...
; Input (keyboards/mice): Alt+i <key>
!i::
; Default is keychron, set above
Input key, I L1 T0.75
if (key = "k") {
keychron := true
dell5550 := false
}
else if (key = "d") {
dell5550 := true
keychron := false
}
else if (key = "n") {
dell5550 := false
keychron := false
}
else
MsgBox, Unknown input shortcut: Alt+i %key%
Return
...
#if dell5550
; Move to start/end of line
F11::send {Home}
F12::send {End}
...
#if
#if keychron
; Remap page and home/end keys
PgUp::send {Home}
PgDn::send {End}
Home::send {PgUp}
End::send {PgDn}
...
#if
; Don't need any remaps for normal (n) keyboard