Page 1 of 1

Help with Keywait for Control Mouse Move

Posted: 03 Dec 2022, 13:20
by arbibarbarona

Code: Select all

Left::
Right::
If !go
SendEvent, {LButton down}
go := True
MouseMove, A_ThisHotkey = "Left" ? -2:2, 0,, R
SetTimer, Stop380, -400
Return
Stop380:
SendEvent, {LButton up}
go := False
Return
Hello guys.

I'm here again and I need some help setting up a Keywait function.
The Upper script works perfectly. But I want to add a similar function that If I press Down Control, It Sends the LButton down then using \, and Insert will move the mouse 12 pixel to left or right, then if I lift the Control up it lifts the LButton up.

Thank you in advance.

Code: Select all

^Left::
^Right::
SendEvent, {LButton down}
Keywait, ^
{
MouseMove, A_ThisHotkey = "^Left" ? -12:12, 0,, R
}
SendEvent, {LButton up}

Return

Re: Help with Keywait for Control Mouse Move

Posted: 03 Dec 2022, 13:29
by boiler
^ is not the key name for Ctrl to be used with KeyWait. It's only Ctrl as a modifier to other keys. Use Ctrl.

Re: Help with Keywait for Control Mouse Move

Posted: 03 Dec 2022, 14:29
by arbibarbarona

Code: Select all


^\::
^Insert::
SendEvent, {LButton down}

{
MouseMove, A_ThisHotkey = "^\" ? -12:12, 0,, R

Keywait, Control
}
SendEvent, {LButton up}

Return
THis seems to just function once. But what If I want to continuesly move the mouse while Left button is Down. Either left or right. and If I lift control up it release the action

Re: Help with Keywait for Control Mouse Move

Posted: 03 Dec 2022, 14:41
by boiler
Instead of KeyWait, use a While loop with GetKeyState().