each click sends key
each click sends key
can someone help me with code i need. i want to every click i do is it will send a key. for example, first rightclick after the click it will send letter a, then next click will letter b, 3rd click will send letter C.
Last edited by gregster on 29 Mar 2023, 13:49, edited 1 time in total.
Reason: Post was split from completely unrelated topic. Another duplicate post - also in an unrelated topic - was disapproved.
Reason: Post was split from completely unrelated topic. Another duplicate post - also in an unrelated topic - was disapproved.
Re: each click sends key
Maybe you need an int value variable, add 1 every time you click, and clear it for the third time.
Re: each click sends key
Welcome to this AutoHotkey forum!
Code: Select all
#Requires AutoHotkey v2.0
~RButton Up:: {
Static n := 0
Send SubStr('abc', ++n := Mod(0 n, 3), 1)
}
Re: each click sends key
@mikeyww,
the leading zero in Mod(0 n, 3) was my AutoHotkey v1 method to read an uninitialized variable as zero.
AutoHotkey v2 (unfortunately) forbids uninitialized variables. Only Mod(n, 3)!
the leading zero in Mod(0 n, 3) was my AutoHotkey v1 method to read an uninitialized variable as zero.
AutoHotkey v2 (unfortunately) forbids uninitialized variables. Only Mod(n, 3)!
Re: each click sends key
Good point! Thank you, Rohwedder.