How do i code: If (Button/Key = Down)

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

User avatar
Marcus Tettmar
Site Admin
Posts: 7380
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Fri Apr 27, 2007 11:07 am

Like this:

LDown
Wait>0.2
LUp
Wait>0.2
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

User avatar
Phil Pendlebury
Automation Wizard
Posts: 538
Joined: Tue Jan 16, 2007 9:00 am
Contact:

Post by Phil Pendlebury » Fri Apr 27, 2007 11:12 am

Jozsa wrote:Sure it does, i just got it to work perfectly :)
Please explain?
Phil Pendlebury - Linktree

Jozsa
Newbie
Posts: 10
Joined: Fri Apr 27, 2007 9:56 am

Post by Jozsa » Fri Apr 27, 2007 11:27 am

Label>Start

OnEvent>KEY_DOWN,VK1,0,LeftMouseDown

SRT>LeftMouseDown
RClick
END>LeftMouseDown

Wait>0.035

Goto>Start




Just replace the RClick with the LDown wait, L stuff.
or Let>X=X+1, whatever you want.

User avatar
Phil Pendlebury
Automation Wizard
Posts: 538
Joined: Tue Jan 16, 2007 9:00 am
Contact:

Post by Phil Pendlebury » Fri Apr 27, 2007 11:46 am

OK neat thanks. :-)
Phil Pendlebury - Linktree

Aaron
Pro Scripter
Posts: 113
Joined: Mon Apr 09, 2007 1:35 am
Location: Wyoming

IF>LUp<>LDown

Post by Aaron » Thu May 17, 2007 8:02 am

Code: Select all


OnEvent>KEY_DOWN,VK1,1,LDownMouseClick

SRT>LDownMouseClick
 Wait>0.2
IF>LUp<>LDown






// EXAMPLE BELOW =======================


// Set Bounds Here

Let>X1=0
Let>Y1=0
Let>X2=0
Let>Y2=0
Let>NotFalse=True


Label>MainLoop
 Wait>0.2

   OnEvent>KEY_DOWN,VK35,5,END

   OnEvent>KEY_DOWN,VK1,1,LDownMouseClick
   GetCursorPos>X1,Y1

Goto>MainLoop

//-----------

SRT>LDownMouseClick
 Wait>0.2
IF>LUp<>LDown
   GoSub>GetUpPosition
ELSE
   GoSub>LDownMouseClick
ENDIF


//------------

SRT>GetUpPosition
 GetCursorPos>X2,Y2
End>GetUpPosition

   GoSub>MsgMod

SRT>MsgMod
 MessageModal>%X1%,%Y1%,%X2%,%Y2%
End>MsgMod

 Goto>MainLoop

SRT>END
 Goto>ENDMACRO
End>END

label>ENDMACRO

//----END-----

Code: Select all


Aaron

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts