Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Single/Double Mouse Window Trigger
#1
I have two triggers for the number 6 position on monitor one. the first bump act's Chrome; when there's two bumps, it act's Chrome and moves it to monitor 2.
QM doesn't seem to like both of those macros with those triggers enabled at the same time. Should QM be able to have a single and double assignment on the same window position? if not, how can I build in a 'wait' for the second bumb?
An old blog on QM coding and automation.

The Macro Hook
#2
Macro single and double
Code:
Copy      Help
int+ g_18243
_i=GetTickCount
int isDouble=GetTickCount-g_18243<500; g_18243=GetTickCount

if isDouble
,out "double"
else
,out "single"
Macro single or double
Code:
Copy      Help
int+ g_18244
if(g_18244) g_18244=0; ret
int isDouble=1
g_18244=1; wait 0.5 -V g_18244; err isDouble=0; g_18244=0

if isDouble
,out "double"
else
,out "single"

;if this is a macro, check "Run simultaneously" in Properties

Quote:Should QM be able to have a single and double assignment on the same window position?
No.
#3
Awesome, just combined them.
Macro Act Chrome
Trigger #6m1 0x4     Help - how to add the trigger to the macro
Code:
Copy      Help
int+ g_18243
_i=GetTickCount
int isDouble=GetTickCount-g_18243<500; g_18243=GetTickCount
ifi- win(" - Google Chrome" "Chrome_WidgetWin_1" "chrome")
,run "$program files$\Google\Chrome\Application\chrome.exe" "" "" "*" ;;Google Chrome

if isDouble
,out "double"
,act win(" - Google Chrome" "Chrome_WidgetWin_1" "chrome")
,MoveWindowToMonitor win() 2 2
else
,act win(" - Google Chrome" "Chrome_WidgetWin_1" "chrome")
An old blog on QM coding and automation.

The Macro Hook
#4
I'm doing this again but it seems to fire the "single" branch and then starts again to execute the "double" branch. 
Is it possible that the version 2.4.11.0 won't run this code correctly?  It is quite old when I started this thread.


Macro retry
Trigger #1m     Help - how to add the trigger to the macro
Code:
Copy      Help
int+ g_18243
_i=GetTickCount
int isDouble=GetTickCount-g_18243<500; g_18243=GetTickCount

if isDouble
,;out "double"
,act win(" - Visual Studio Code" "Chrome_WidgetWin_1" "Code")
else
,;out "single"
,act win("EditPad Pro 7" "TFormEditPadPro7" "EditPadPro7")
An old blog on QM coding and automation.

The Macro Hook
#5
I guess the macro should be like the "single or double" example, not like "single and double" example.
#6
Yep.  that way works.
thanks.
An old blog on QM coding and automation.

The Macro Hook


Forum Jump:


Users browsing this thread: 1 Guest(s)