Jump to content

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

Double press



  • Please log in to reply
2 replies to this topic
lilygel
  • Members
  • 249 posts
  • Last active: May 26 2017 04:13 AM
  • Joined: 18 Feb 2015
~RShift::
if (A_PriorHotkey <> "~RShift" or A_TimeSincePriorHotkey > 400)
{
    ; Too much time between presses, so this isn't a double-press.
    KeyWait, RShift
    return
}
gosub InputB

return
So here's a snippet I copied off the help file and I use it to launch an input box. My problem is it gets triggered when I'm typing. For example I press Shift, s, shift, it triggers. How do I prevent that from happening?

Exaskryz
  • Members
  • 3249 posts
  • Last active: Nov 20 2015 05:30 AM
  • Joined: 23 Aug 2012
✓  Best Answer

In this case, I would just change the A_PriorHotkey to A_PriorKey and change the "~RShift" to "RShift".



lilygel
  • Members
  • 249 posts
  • Last active: May 26 2017 04:13 AM
  • Joined: 18 Feb 2015
Awesome!
Frankly speaking, I read the description of those built-in variables but I have no idea what it mean. lol