How do I make 'c' send 'a' here? Topic is solved

Ask gaming related questions (AHK v1.1 and older)
Guest

How do I make 'c' send 'a' here?  Topic is solved

22 Dec 2017, 12:25

Code: Select all

a::
send {b}
return
c::
send {a}
return
How do I make 'c' send 'a'?
rdllngr
Posts: 54
Joined: 22 Sep 2017, 09:39

Re: How do I make 'c' send 'a' here?

22 Dec 2017, 13:18

Include "$" before the hotkey. :)
It forces the hook in the hotkey.

Code: Select all

$a::
Send, b
return

$c::
Send, a
return
Guest

Re: How do I make 'c' send 'a' here?

22 Dec 2017, 14:13

rdllngr wrote:Include "$" before the hotkey. :)
It forces the hook in the hotkey.

Code: Select all

$a::
Send, b
return

$c::
Send, a
return
Thank you. What if I want to use this?

Code: Select all

capslock & a::
It doesn't let me.
rdllngr
Posts: 54
Joined: 22 Sep 2017, 09:39

Re: How do I make 'c' send 'a' here?

22 Dec 2017, 15:39

You can try this.

Code: Select all

$a::
while GetKeyState("CapsLock", "P")
	{
	Send, b
	KeyWait, a
	return
	}
return

$c::
Send, a
return
User avatar
Scr1pter
Posts: 1278
Joined: 06 Aug 2017, 08:21
Location: Germany

Re: How do I make 'c' send 'a' here?

26 Dec 2017, 18:31

rdllngr wrote:Include "$" before the hotkey. :)
It forces the hook in the hotkey.

Code: Select all

$a::
Send, b
return

$c::
Send, a
return
Interesting, but what exactly do you mean by "It forces the hook in the hotkey."?
I understand the words, but I don't get the meaning...
Please use [code][/code] when posting code!
Keyboard: Logitech G PRO - Mouse: Logitech G502 LS - OS: Windows 10 Pro 64 Bit - AHK version: 1.1.33.09
cocobanana
Posts: 19
Joined: 31 Oct 2017, 05:43

Re: How do I make 'c' send 'a' here?

26 Dec 2017, 18:59

rdllngr hat geschrieben:
Include "$" before the hotkey. :)
It forces the hook in the hotkey.

Code: [Alles auswählen]GeSHi © Codebox Plus
$a::
Send, b
return

$c::
Send, a
return


Interesting, but what exactly do you mean by "It forces the hook in the hotkey."?
I understand the words, but I don't get the meaning...
From Ahk Docs

$
This is usually only necessary if the script uses the Send command to send the keys that comprise the hotkey itself, which might otherwise cause it to trigger itself. The $ prefix forces the keyboard hook to be used to implement this hotkey, which as a side-effect prevents the Send command from triggering it. The $ prefix is equivalent to having specified #UseHook somewhere above the definition of this hotkey.
User avatar
Scr1pter
Posts: 1278
Joined: 06 Aug 2017, 08:21
Location: Germany

Re: How do I make 'c' send 'a' here?

26 Dec 2017, 19:22

Ah, now it seems to be clear.
Well, in other words, the $ breaks the chain.
If you specify that a = b, and c = a, the chain, when pressing c, would be c -> a -> b
The $ prevents this.

Thanks!
Please use [code][/code] when posting code!
Keyboard: Logitech G PRO - Mouse: Logitech G502 LS - OS: Windows 10 Pro 64 Bit - AHK version: 1.1.33.09

Return to “Gaming Help (v1)”

Who is online

Users browsing this forum: No registered users and 56 guests