Say for example, while TAB is held down, and the mouse is being moved to the right, it sends a command.
So for example:
-First, record the starting position of the cursor with MouseGetPos
-First, record the second position of the cursor with MouseGetPos again
-Then, move the cursor up to 25 pixels to the right of the starting point, and it sends keystroke A one time (not repetitively)
-Continue to move the cursor to the right, and when it hits 50 pixels from the starting point, it sends keystroke B one time (not repetitively)
-Continue to move the cursor to the right, and when it hits 75 pixels from the starting point, it sends C one time (not repetitively)
...and so forth.
I've been playing with this all night but can't get it. I'll post what I have so far, any chance someone could take a look at this? Thanks in advance..
Code: Select all
SendMode Input
CoordMode Mouse, Screen ;doesn’t matter where mouse cursor is
SetMouseDelay,-1
p=1 ;how many pixels in any direction the mouse must move before it sends a keystroke (you can experiment with this)
tab::
Loop
{
GetKeyState, state, tab, p
if state = u
break
if state = d
MouseGetPos x1,y1 ;original cursor position
MouseGetPos x2,y2 ;second cursor position
dx:= (x2-x1)//p, dy:= (y2-y1)//p
If (dx between 0 and 24)
{
sendinput, A
}
If (dx between 25 and 49)
{
sendinput, B
}
If (dx between 50 and 74)
{
sendinput, C
}
If (dx between 75 and 99)
{
sendinput, D
}
Return