Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

hold arrow while both mouse buttons are pressed


Best Answer Jackie Sztuk _Blackholyman , 08 May 2013 - 11:17 AM

Go to the full post »


  • Please log in to reply
2 replies to this topic
Anasa
  • Members
  • 2 posts
  • Last active: May 16 2013 06:52 PM
  • Joined: 08 May 2013
Why doesn't this work? It seems to do nothing. I want to hold the up arrow if both mouse buttons are being held, and to let go of the arrow if either of them is released.
 
pressing := 0 ;false
Loop
{
   L := Getkeystate(LButton)
   R := Getkeystate(RButton)
   if (!pressing AND (L AND R))
   {
      Send {Up Down}
      pressing := 1 ;true
   }
   if (pressing AND (!L OR !R))
   {
      Send {Up Up}
      pressing := 0 ;false
   }
   sleep 20
}


Jackie Sztuk _Blackholyman
  • Spam Officer
  • 3757 posts
  • Last active: Apr 03 2016 08:47 PM
  • Joined: 28 Feb 2012
✓  Best Answer
this may work

~LButton & RButton::
while GetKeyState("LButton", "P") && GetKeyState("RButton", "P")
   {
      Send {Up down}
   }
Send {Up Up}
return


esc::ExitApp
Hope it helps
Helping%20you%20learn%20autohotkey.jpg?d

[AHK] Version. 1.1+ [CLOUD] DropBox ; Copy [WEBSITE] Blog ; About

Anasa
  • Members
  • 2 posts
  • Last active: May 16 2013 06:52 PM
  • Joined: 08 May 2013

Thanks. I didn't know about the ~, but it quickly became clear what it does.

I can only get it to work if I first hold one button, then the other, depending on the order in which they are listed in the multi-hotkey declaration. That's fine though, because it kinda makes sense for how it will be used, once I switched it to:

 

 

~RButton & LButton::
 
It's for D&D Online, which has a very WoW-like interface, except it's missing the bit where you hold both buttons to move forward. It's intuitive to first hold the right mouse button to enter mouse-look mode, and then press the left button to move forwards.