Double Pressing Script Topic is solved

Get help with using AutoHotkey and its commands and hotkeys
plciula
Posts: 4
Joined: 11 Dec 2017, 23:26

Double Pressing Script

11 Dec 2017, 23:33

Hello All,

I'm pretty new to AHK, so forgive me if I'm being silly. I have a media key that I would like to utilize for two different functions. I compiled this based off what I could find in documentation.

Code: [Select all] [Expand] [Download] (Untitled.ahk)GeSHi © Codebox Plus



Unfortunately, when I double click the key, it outputs "Single PressDouble Press"

Any ideas why this might be happening?
xatmo

Re: Double Pressing Script

12 Dec 2017, 06:43

the way you have it now the send outside the if will still get executed even if the if statement is true or not. u should prob put the outside send with an else
plciula
Posts: 4
Joined: 11 Dec 2017, 23:26

Re: Double Pressing Script

12 Dec 2017, 08:43

Not quite. When I press the key only once, it only sends "Single Press".
User avatar
Delta Pythagorean
Posts: 410
Joined: 13 Feb 2017, 13:44
GitHub: DelPyth
Location: Equestria

Re: Double Pressing Script

12 Dec 2017, 09:28

Anything inside the IF, will be executed if you press the key once, anything outside the IF will be executed after you press it twice.
There no... easy way to go around this, but I do have one way to do it.

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus

plciula
Posts: 4
Joined: 11 Dec 2017, 23:26

Re: Double Pressing Script

12 Dec 2017, 13:10

Unfortunately, that doesn't seem to work either. It still sends "Single PressDouble Press" with every double press. Otherwise both your revision and my original code works just fine. The only thing that isn't working, is the need to suppress the output "Single Press" when the key is double pressed.
User avatar
Bon
Posts: 15
Joined: 11 Jan 2014, 07:31

Re: Double Pressing Script

13 Dec 2017, 10:58

Quidquid Latine dictum sit altum videtur
"Anything said in Latin sounds profound"
User avatar
jeeswg
Posts: 4104
Joined: 19 Dec 2016, 01:58
Location: UK

Re: Double Pressing Script  Topic is solved

20 Dec 2017, 17:27

I had a go at a double press hotkey script:

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus

BoBo
Posts: 2513
Joined: 13 May 2014, 17:15

Re: Double Pressing Script

21 Dec 2017, 02:32

@ plciula
any reason why you've posted your thread in a section like this:
Scripts and Functions
Post your working scripts, libraries and tools


... instead of "Ask for Help" (where we moved it to - on your behalf) ??

:thumbdown:
plciula
Posts: 4
Joined: 11 Dec 2017, 23:26

Re: Double Pressing Script

22 Dec 2017, 12:56

Sorry all, been a little busy to mess around with the script.

@Bon
I'm sure that my answer is hidden in the page you linked, just haven't had time to look into it.

@jeeswg
Your solution works perfectly. I have marked it as the answer.

@BoBo
It's because I'm new to the forum, and didn't know that section existed.

Return to “Ask For Help”

Who is online

Users browsing this forum: jcash, mattman, PuzzledGreatly, TAC109, truekefir and 46 guests