I'm new to AutoHotKey and am trying to create a script to let me use my Roku's Bluetooth remote with my PC. The issue with the remote is that all the keys are weird. What I would like is so that when I press x and y at the same time, all the necessary keys are remapped to the ones for the remote and vise-versa for the keyboard. Here is what I have right now (doesn't work):
state = keyboard
loop{
if (GetKeyState("x", "P") && GetKeyState("y", "P")){
if (state == "keyboard") {
state = roku
Sleep 30
}
else if (state == "roku") {
state = keyboard
Sleep 30
}
}
if (state == "roku"){
4::send h
u::send {up}
l::send {left}
r::send {right}
d::send {down}
e::send {esc}
6::send {backspace}
c::send r
8::send f
s::send {enter}
3::send c
a::send {space}
}
}
Does anyone know why this doesn't work?