What I am trying to do: I am trying to momentarily block RButton on mouse for 100MS and then return RButton to the exact state it was in before I blocked imput from it. I am trying to block it when either the 1 2 or 3 key is pressed on my keyboard. So I press 2, it will momentarily block RButton and run a simple keypress macro. Here is the code I have.
Code: Select all
2WasPressedAt:=A_TickCount-100
~*2::2WasPressedAt:=A_TickCount
#if A_TickCount-2WasPressedAt<100
~RButton::return ; Should suspend Rbutton for 100MS
~2:: ; Macro to be run when 2 is pressed.
sleep 10
send, {~$2 down} ; Should press 2 in program but not activate macro again
send, {~$2 up} ; Should release 2 in program but not activate macro again
sleep 10
send, {5 down}
sleep 60
send, {5 up}
sleep 60
send, {4 down}
sleep 60
send, {4 up}
sleep 60
send, {6 down}
sleep 60
send, {6 up}
return
I feel like I am close to getting this to work, any help appriciated. The sequence of events that I am trying to accomplish would look like this.
I am holding down Rbutton, as soon as I press either 1 2 or 3 on keyboard, it will momentaraly disable RButton, send the key (either 1 2 or 3) to the program window, return RButton to the pressed position because I haven't taken my finger off the RButton, so it would be in the same state it was in before I pressed 1 2 or 3, and it also activates the macro listed above. Im not sure if I need to be using #blockinput on/off or what I am missing.
Sorry if this is confusing, ive been working on this for awhile and have been learning this software for about a month now, I have no programming experience as I am sure you can tell =)
Any help appriciated, thank you.