Jump to content

So I'm starting to use Autohotkey (https://www.autohotkey.com/) software to create some hotkeys for me in games. Right now I want to make so when I input button "d" the output will be "up arrow" followed by "s" button almost instantaneously. This is what I got right now and it doesn't seem to work;

 

---
D::
{
   send, up
   send, s
Return
}

---

 

If anyone else use this software and know how to function it, may you please help me with this code?

 

Thanks

Link to comment
https://linustechtips.com/topic/530815-autohotkey-hotkey-software-help/
Share on other sites

Link to post
Share on other sites

From my experience, some games cant register single frame button presses, so you need to emulate yourself holding the button down for a few milliseconds

 

Here is a guide

https://autohotkey.com/board/topic/111737-how-to-make-ahk-work-in-most-games-the-basics/

Long live Stalin, he loves you; sing these words, or you know what he’ll do!

Link to post
Share on other sites

First, your hotkey should be a lowercase d.  Hotkeys are case-sensitive in AHK.  You also don't need the curly braces here--if there are multiple hotkeys in one file, you can put return at the end of each one to stop the program from running amok and running multiple ones in one go.  If that's your only hotkey, though, you don't need either of those.  But the braces aren't actually hurting anything as they are.

 

Second, if you're using this in a game, plain-old send might not be what you want.  You probably want sendplay or maybe sendinputsendplay works better with most games than just send.  sendplay doesn't actually emulate you as the userpressing a key and then hand it off to the OS to deal with, but rather, sends an "event" to the currently active window that has the same effect as pressing a button.  sendinput is just generally better than send--it's faster (nearly instantaneous for pretty decently large chunks of text), and because it's so fast, it's generally a better option.  There's less chance for something to pop up or interrupt the typing.

 

Also, send interprets most of what you put after it as literal text.  So, send up will type a u, then a p.  To send a special key, put the name of the key in curly braces:  {up}, {space}, {escape}, etc.

 

Your code should probably look something like:

d::sendplay {up}s

And then a return if there are more hotkey combinations after it.

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×