Jump to content

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

Basic toggle script. Right Mouse Button


  • Please log in to reply
4 replies to this topic
chewz
  • Members
  • 1 posts
  • Last active: Mar 11 2011 05:09 AM
  • Joined: 11 Mar 2011
Very simple, I just want to be able to click my right mouse button once and the script will 'hold' the button down until I click it once again. Thanks

MasterFocus
  • Moderators
  • 4323 posts
  • Last active: Jan 28 2016 01:38 AM
  • Joined: 08 Apr 2009
KeyWait is the solution.
[color=violet]$[/color][color=darkred]RButton[/color]:: ; see [color=violet]hotkey modifiers[/color]
  Send, {[color=darkred]RButton[/color] Down}
  KeyWait, [color=darkred]RButton[/color] ; see [color=black]KeyWait[/color]
  KeyWait, [color=darkred]RButton[/color], D
  KeyWait, [color=darkred]RButton[/color]
  Send, {[color=darkred]RButton[/color] Up}
Return

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Antonio França -- git.io -- github.com -- ahk4.net -- sites.google.com -- ahkscript.org

Member of the AHK community since 08/Apr/2009. Moderator since mid-2012.


CodeKiller
  • Members
  • 2067 posts
  • Last active: Feb 26 2016 09:30 AM
  • Joined: 10 Jul 2008
You can also use something like that :
$RButton::
	If NotPushed := Not NotPushed
		Send {RButton Down}
	Else
		Send {RButton Up}
Return


MasterFocus
  • Moderators
  • 4323 posts
  • Last active: Jan 28 2016 01:38 AM
  • Joined: 08 Apr 2009
Yes.
$RButton:: Send, % "{RButton " ( (Toggle:=!Toggle) ? "Down" : "Up" ) "}"

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Antonio França -- git.io -- github.com -- ahk4.net -- sites.google.com -- ahkscript.org

Member of the AHK community since 08/Apr/2009. Moderator since mid-2012.


xtimqx
  • Guests
  • Last active:
  • Joined: --
i need something similar.
loop where:
button is pressed for 1h,
released and pressed again,
pressing the button again releases it and breaks the loop.