Jump to content

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

Ternary Operator Provides Goto "Labels" for Single & Double-Click Hotkey


  • Please log in to reply
No replies to this topic
pixelporter
  • New members
  • 1 posts
  • Last active: Sep 29 2015 12:36 AM
  • Joined: 18 Sep 2015
Ternary Operator Provides Goto "Labels" for Double-Click Hotkey
; Example using the "END" key as a Double-Click Hotkey (Single-Click Function Maintained)

$END::goto, % (A_PriorHotkey=A_ThisHotkey && A_TimeSincePriorHotkey < 350 ? "rload" : "thiskey")

thiskey:   ; Single Press Directed here to make this Key perform it's usual function

sendinput % "{" Ltrim(A_ThisHotkey,"$~*") "}"

return


rload:  ; Double-Click Directed here to execute the code below this label

Reload

; Return ; ( Uncomment this return if you're replacing the "Reload" command above with other code )