Code: Select all
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
Timer_State =0 ; off
esc::exitapp
#IfWinActive, DX31
e::
Timer_State := !Timer_State ; toggle 0 or 1
If Timer_State =1
SetTimer, trigger1, 10
Else
SetTimer, trigger1, Off
return
trigger1:
Critical ; doesn't interrupt this thread with other timers
Mousegetpos, x
sleep 5
mousegetpos, x2
if x2 != %x%
{
tooltip, clicked ; delete this line if you don't want notification - useful for testing
sleep 111
send, K
sleep 111
send, H
tooltip
}
return
F7::ExitApp
CapsLock::Suspend
F4::Reload
Here comes the thing (not sure if AutoHotKey allows this):
I want it to behave like this, that if you move your mouse to the left, it will send K (only), now if you move your mouse to the left again, it should not send K until you move your mouse to the right, which will then send H (only). Same goes for the right side. Move your mouse to the right, send H, move your mouse to the right again, don't send anything until mouse has been moved to the left side. That means that AutoHotKey should somehow detect whether you moved to the left or right. Is that possible?
You should get the following results:
Move Mouse Left = Left Side
Move Mouse Right = Right Side
Left Side - K
Left Side -
Right Side - H
Right Side -
Or:
Left Side - K
Right Side - H
Left Side - K
Left Side -
Right Side - H
Left Side - K
Right Side - H
Right Side -
I hope my explanation is as detailed as possible. I also hope that this is possible somehow!