Binded button can't send it Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
KongKing
Posts: 76
Joined: 22 May 2022, 09:41

Binded button can't send it

Post by KongKing » 26 May 2022, 11:53

Hello! I have a bind that is used to click the left mouse button and if I have a bind under "b" for example and want to send b somewhere, it doesn't send, do you know how to fix it?


Code: Select all

Gui, Show, w300 h300, gui
Gui, Add, Edit, vl , b
Gui, Add, Button,, Save
return



ButtonSave:
Gui, Submit, NoHide
Hotkey, %l%, l
return

Toggle = 0

#MaxThreadsPerHotkey 2

l:
{
    Toggle := !Toggle
     While Toggle{
        Click
        sleep 11
        click
        sleep 11
        click
        sleep 11
        click
        sleep 11
        click
        sleep 11
        click
        sleep 11
        click
     
    }
}

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

Re: Binded button can't send it

Post by mikeyww » 26 May 2022, 12:18

When you test it in Notepad, what happens?

The AHK documentation is a good source of information and examples of scripts. Here is an example of how to use Return to end a hotkey routine.

https://www.autohotkey.com/docs/Program.htm

Your script does not send B anywhere. You have to press the key yourself. That's how it works.

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

Re: Binded button can't send it  Topic is solved

Post by Rohwedder » 26 May 2022, 12:33

Hallo,
replace:

Code: Select all

Hotkey, %l%, l
by:

Code: Select all

Hotkey, ~%l%, l
Tilde: ~ prefix when the hotkey fires, its key's native function will not be blocked.

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

Re: Binded button can't send it

Post by mikeyww » 26 May 2022, 12:37

Sorry if I misunderstood the problem!

KongKing
Posts: 76
Joined: 22 May 2022, 09:41

Re: Binded button can't send it

Post by KongKing » 26 May 2022, 13:43

Rohwedder thank you very much for your help, mikeyww you didn't understand me completely, but also thank you :superhappy:

KongKing
Posts: 76
Joined: 22 May 2022, 09:41

Re: Binded button can't send it

Post by KongKing » 26 May 2022, 14:31

Can you tell me how to do that I can hold e.g. ctrl or shift and let the script run?

KongKing
Posts: 76
Joined: 22 May 2022, 09:41

Re: Binded button can't send it

Post by KongKing » 26 May 2022, 15:16

Okay that's it, I already fixed it

ka3kaa
Posts: 1
Joined: 30 Apr 2023, 18:08

Re: Binded button can't send it

Post by ka3kaa » 30 Apr 2023, 18:14

will you tell me how?

Post Reply

Return to “Ask for Help (v1)”