Execute backtick

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
xavierbaez
Posts: 6
Joined: 05 Feb 2023, 06:46

Execute backtick

Post by xavierbaez » 05 Feb 2023, 06:52

Could you please help me friends :|

This should work all I want is to execute
1 - Git Bash with One Click
2 - Calculator with Two Clicks

Here is the code:

Code: Select all

#~::
    KeyWait, ~            ; wait for ~ to be released
    KeyWait, ~, D T0.7        ; and pressed again within 0.2 seconds
    if ErrorLevel  {          ; timed-out (only a single press)
        Run "C:\Program Files\Git\git-bash.exe" --cd-to-home
   } Else
        Run C:\Program Files (x86)\SpeedCrunch\speedcrunch.exe
Return
It does NOT work with

Code: Select all

#~::
Windows + `

It works if I use

Code: Select all

#+~::
Windows + Shift + `

xavierbaez
Posts: 6
Joined: 05 Feb 2023, 06:46

Re: Execute backtick

Post by xavierbaez » 05 Feb 2023, 07:08

How can I edit my original post so I can change the Subject?

gregster
Posts: 8990
Joined: 30 Sep 2013, 06:48

Re: Execute backtick

Post by gregster » 05 Feb 2023, 07:14

As a new user, you can't. If you only want to add a better subject (aka topic title), I can edit it for you, if you tell us the new one.
I can also add more text to the initial post, if you like.
Your topic seems to be about using the backtick or the tilde as a hotkey, afaics, assuming that they share a key on your keyboard layout.

If you want to ask a different question, then you should create a new topic.
(and if you consider this topic here solved, you should tell your potential helpers.)

Rohwedder
Posts: 7616
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: Execute backtick

Post by Rohwedder » 05 Feb 2023, 07:20

Hallo,
I assume that your key without Shift produces Grave Accent `
try:

Code: Select all

#+`::
    KeyWait, `            ; wait for ` to be released
    KeyWait, `, D T0.7    ; and pressed again within 0.2 seconds
    if ErrorLevel  {      ; timed-out (only a single press)
        Run "C:\Program Files\Git\git-bash.exe" --cd-to-home
   } Else
        Run C:\Program Files (x86)\SpeedCrunch\speedcrunch.exe
Return

xavierbaez
Posts: 6
Joined: 05 Feb 2023, 06:46

Re: Execute backtick

Post by xavierbaez » 05 Feb 2023, 07:23

Yes but it doesn’t let me use ` in the script

That is why I’m asking for help
Grave Accent doesn’t work in the script

User avatar
mikeyww
Posts: 26856
Joined: 09 Sep 2014, 18:38

Re: Execute backtick

Post by mikeyww » 05 Feb 2023, 10:57

Code: Select all

KeyWait ``
KeyWait ``, DT.7
Explained: Escape sequences

xavierbaez
Posts: 6
Joined: 05 Feb 2023, 06:46

Re: Execute backtick

Post by xavierbaez » 05 Feb 2023, 22:47

Okay this is what I ended up with

Code: Select all

#`::
    KeyWait, ``               ; wait for ` to be released
    KeyWait, ``, D T0.7       ; and pressed again within 0.2 seconds
    if ErrorLevel  {          ; timed-out (only a single press)
        Run "C:\Windows\System32\cmd.exe"
   } Else
        Run C:\Program Files (x86)\SpeedCrunch\speedcrunch.exe
Return
This works with Win + backtick and detects double clicks 😬

xavierbaez
Posts: 6
Joined: 05 Feb 2023, 06:46

Re: Execute backtick

Post by xavierbaez » 05 Feb 2023, 23:37

Okay now is there any way to use
KeyWait
to do
1) One Key stroke
2) Two key strokes
3) Three key strokes


Post Reply

Return to “Ask for Help (v1)”