AutoHotkey SendInput Problems

1.6k views Asked by At

[Key Mappings of New Media Remote]

https://i.stack.imgur.com/ivMSK.png

Using AutoHotkey I want to interrupt Keyboard Keys sent like AppsKey and Browser_Home and send another key instead. Unfortanately the best I can manage is to send a key as well as the key function.

F3::SendInput {a}

Browser_Home::SendInput {a}

Browser_Home::SendInput a

Browser_Home:: a

The first line 'F3 to a' works as intended; the F3 Key outputs the letter a. The 2nd and 3rd line Browser_Home only launches Browser to Home. The 4rd line launches the Browser_Home as well as outputting the letter a.

Anyone know what I'm doing wrong / know how to fix my script to output a without launching browser to home?

1

There are 1 answers

2
errorseven On

According to documentation under Hotkey:

$ 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

Try this and report back: $Browser_Home::SendInput {a}