AHK for enter and arrow key

Viewed 4122

Can't seem to find this simple script anywhere. I'm trying to create a script that runs when the enter and right arrow key is pressed.

Here's what I've tried so far:

{Enter}{Right}::
    Send, #tab
return

I know it must be something really simple but can't find the solution anywhere!

1 Answers

Here's the documentation link for hotkeys:
https://www.autohotkey.com/docs/Hotkeys.htm
And in there, after understanding the basics, you're interested in this part of it:
https://www.autohotkey.com/docs/Hotkeys.htm#combo

And assuming by #tab you mean pressing Windows key and the Tab key, you want to look at this page of the documentation:
https://www.autohotkey.com/docs/misc/Remap.htm
(If you wanted to use the Send command, it'd be Send, #{Tab})

You should end up with this:
Enter & Right::#Tab (have to press enter before right arrow key)
And that works, though you're probably going to want to add one little addition, which the ~ modifier.
It'll make it so your Enter key also works on itself while the script is active.
So you'd end up with this:
~Enter & Right::#Tab

Though, now you'll always send a Enter keystroke every time you run the hotkey, which might not be good, I recommend switching it around to:
~Right & Enter::#Tab

Related