Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Checking State of Mouse button
#1
Hi,
I feel I should know this but couldn't figure it out or find it in the forum.

Is it possible to check a mouse button state and then run code depending on that state (1 verus 0)?

This is different than mouse chording.

Related question:

In the wait dialog, it offers "Wait for Key Up" and "Wait for Key Down"
but only offers "Wait for Mouse Button Up"
Is there a reason for this? Can I have a wait for a click down on a mouse button?

Thanks so much!!!!

Stuart
#2

Press Alt to stop macro from running.


Code:
Copy      Help
;s

0.1
ifk- (1)
,out 0
else
,out 1
ifk A
,mes "MACROS HAS STOPPED"
,end

goto s
#3
Function WaitForMouseButtonDown
Code:
Copy      Help
;/
function ^waitmax button ;;waitmax: 0 is infinite.  button: 1 left, 2 right, 4 middle, 5 6 X


if(waitmax<0 or waitmax>2000000) end ES_BADARG
opt waitmsg -1

int wt(waitmax*1000) t1(GetTickCount)
rep
,0.01
,
,ifk((button)) ret
,
,if(wt>0 and GetTickCount-t1>=wt) end "wait timeout"
#4
Hi John and Gintaras,

Thank you both so much -- I love QM and the QM Forum!
Stuart


Forum Jump:


Users browsing this thread: 1 Guest(s)