0
votes

I want to do Multi Clicks with the same Keyboard Shortcuts to Run a Ahk Script.

I now in Autohotkey Languages, you can write a code that can execute a part of Code, if a certain Keyboard Shortcut combination is pressed.

But i want on my Windows System, to Click a count of the same keystroke combinations to execute a part of Code.

The pros are: you do not have to move your fingers to a other place on that keyboard, Click it again and it will run a other Code. (this will improve my keyboard Movements and i have more options to do keystrokes.)

Example:

Click - Ctrl + (1x)c - to CopyText

DoubleClick - Ctrl + (2x)c - to CopyText + GoogleSearch

multiClick - Ctrl + (5x)c - ?

If you look to this Example Script then you can see what i mean.

(note - Hotkey > [^cc::] or hotkeystring > [:*:^cc::]- this does not work, is there another way to solved this)

; [+ = Shift] [! = Alt] [^ = Ctrl] [# = Win] 
#SingleInstance force

;MultiClicks the Same Keyboard Shortcuts to Run a Ahk Script

;Click Ctrl + c to [copy text]
^c::
send ^c
;msgbox script1
return

;DoubleClick Ctrl + (2x)c  [copy text] + [do a google search]
^cc::
send ^c
sleep 200
run https://www.google.com/?q=%clipboard%
;msgbox script2
return

;MultiClicks Ctrl + (5x)c  to run script5
^ccccc::
;?
;msgbox script5
return

esc::exitapp
1
Try this.user3419297
I did test it out, and it works for hotkey>[^cc::] and i must say it is a cool thing, Do you now how you can do that with a hotkeystring > something like this [::^cv::] or [^cv::] - i want to use it also for more then one keys. ps -you did answer the question correctFrank Quardro

1 Answers

-1
votes
^c::
{
    count++
    SetTimer, actions, 400 ;время за которое нужно нажать комбинацию
}
return

actions:
{
    if (count = 1)
    {
    msgbox CTRL+C
    }
    else if (count = 2)
    {
    msgbox CTRL+CС
    }
    else if (count = 5)
    {
    msgbox CTRL+CСССС
    }
    count := 0
}