Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Relative Record Key "Toggle" option does not work #260

Open
sfetrzak opened this issue Jul 11, 2023 · 1 comment
Open

Relative Record Key "Toggle" option does not work #260

sfetrzak opened this issue Jul 11, 2023 · 1 comment

Comments

@sfetrzak
Copy link

There is a bug in Recording.ahk in line 523/531 and 553/560 -> "ToggleMode" variable should be used instead of "Toggle"

ClickOn(xPos, yPos, Button, Click := "")
{
	global RelHold, LastPos, RelKey, ToggleMode
	If (RelHold = 1)
	{
		Loop, Parse, LastPos, /
			iPar%A_Index% := A_LoopField
		Relative := RelToLastPos(iPar1, iPar2, xPos, yPos)
	}
	LastPos := xPos "/" yPos
	If (GetKeyState(RelKey, ToggleMode))
	{
		xPos := "Rel 0"
		yPos := 0
		RelHold := 1
	}
	If (Relative != "")
		Details := Relative " " Button ", " Click
	Else
		Details := xPos ", " yPos " " Button ", " Click
	return Details
}

RelToLastPos(lX, lY, cX, cY)
{
	cX -= lX
	cY -= lY
	return "Rel " cX "`, " cY
}

MoveCheck()
{
	global MDelay, LastPos, RelKey, ToggleMode, CoordMouse
	CoordMode, Mouse, %CoordMouse%
	MouseGetPos, xPos, yPos
	If (LastPos = xPos "/" yPos)
		return
	If (A_TimeIdle < MDelay)
		return
	If (GetKeyState(RelKey, ToggleMode))
	{
		Loop, Parse, LastPos, /
			iPar%A_Index% := A_LoopField
		MovedPos := RelToLastPos(iPar1, iPar2, xPos, yPos)
	}
	Else
		MovedPos := xPos ", " yPos
	LastPos := xPos "/" yPos
	return MovedPos
}
@WAZAAAAA0
Copy link

Thanks for the fix. Makes recording mouse movement in Relative mode easier. This should be merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants