윾마루
윾마루

Reputation: 1

AutoHotKey Recognizing itself as an input

I was making a real-time translator(not translate btw), that when I type a letter in my language, It automatically types an alphabet of corresponding sound.

r::
Send, t
return

You get the Idea, when I press 'r', It writes 't' instead.

Then the problem happened. As I added more and more letters, I stumbled upon this part:

f::
Send, r
return

When I type f, it types r. Then it thought that I typed r (in fact, the program typed it), so it types t.

Ultimately, it types t when I press f. (which is not intended)

Is there a parameter or something that prevents it from recognizing its own key input as an input?

(also, I don't want to do this:

^r::
Send, t
return

Sure, This will solve the problem, but I have to hold the Ctrl key the whole time.)

Upvotes: 0

Views: 32

Answers (2)

0x464e
0x464e

Reputation: 6489

Good that you found the remapping syntax, it's very handy and is indeed what you want to use for this.
And for future reference, to solve the problem of Sending triggering hotkeys, you want to use $.

$2::MsgBox, % "You wont see me if you press 1"

1::SendInput, 2

Upvotes: 1

윾마루
윾마루

Reputation: 1

I solved it, just had to do this

r::t
f::r

...

Upvotes: 0

Related Questions