Some code to detect and act on a mouse click in a specific area of the screen. For more details see this thread:
http://www.mjtnet.com/forum/viewtopic.php?p=11421#11421
// Set Bounds Here
Let>X1=440
Let>X2=630
Let>Y1=40
Let>Y2=200
// Only detect clicks on Desktop, or Anywhere?
Let>OnlyDesktop=1
OnEvent>KEY_DOWN,VK1,0,MouseClick
Label>MainLoop
Wait>0.2
Goto>MainLoop
SRT>MouseClick
GetActiveWindow>title,xact,yact
// OnlyDesktop/all window check
Let>OkToContinue=FALSE
If>OnlyDesktop=1
If>title=Program Manager
Let>OkToContinue=TRUE
Endif
Else
Let>OkToContinue=TRUE
Endif
If>OkToContinue=TRUE
// Check Cursor is Within Bounds
GetCursorPos>X,Y
If>{((%X% >= %X1%) AND (%X% = %Y1%) AND (%Y% command or call to a subroutine
MessageModal>Hello
// Macro>your_macro
// Pass LClick on?
// LClick
Endif
Endif
END>MouseClick
Activate macro with screen click
Moderators: Dorian (MJT support), JRL, Phil Pendlebury
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Activate macro with screen click
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?