Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate

how to bind multiple keys into 1 button


  • Please log in to reply
18 replies to this topic
Nabuang
  • Guests
  • Last active:
  • Joined: --
Hi im new here and ive been studying AHK but its kinda hard so heres my question.

How can i bind my d, s, a, w into 1 button

Thanks!
:D

  • Guests
  • Last active:
  • Joined: --
example:
1::send dsaw

press 1 and it will send d, s, a, w keys

Nabuang
  • Guests
  • Last active:
  • Joined: --
Thank alot!!

Nabuang
  • Guests
  • Last active:
  • Joined: --
Is there anyway to make that code without using "send, sendraw, sendinput, sendplay and sendevent"

ruespe
  • Members
  • 567 posts
  • Last active: Dec 01 2014 07:59 PM
  • Joined: 17 Jun 2008
Yes. Have a look at Hotstrings.
::1::dsaw


Nabuang
  • Guests
  • Last active:
  • Joined: --
nope it doesn't work it just gives me "1"

Frankie
  • Members
  • 2930 posts
  • Last active: Feb 05 2015 02:49 PM
  • Joined: 02 Nov 2008
You need to press space after you type 1.
aboutscriptappsscripts
Request Video Tutorials Here or View Current Tutorials on YouTube
Any code ⇈ above ⇈ requires AutoHotkey_L to run

ruespe*
  • Guests
  • Last active:
  • Joined: --
And I wrote:

Have a look at Hotstrings.

rtfm

n3cr0p0t3nc3
  • Members
  • 2 posts
  • Last active: Feb 23 2009 12:03 PM
  • Joined: 19 Feb 2009
yea i looked at the hotstring but still it wont work on the game :cry:
i used send, sendplay, sendinput and send raw but nothing works.

OceanMachine
  • Members
  • 790 posts
  • Last active: Aug 23 2013 02:10 PM
  • Joined: 15 Oct 2007
Have you found the window before trying to send the keys?

Also you might try using SendPlay instead of the other methods. I suggested SendPlay because of the below line in the manual.

From the AHK Manual:

SendPlay's biggest advantage is its ability to "play back" keystrokes and mouse clicks in a broader variety of games than the other modes. For example, a particular game may accept hotstrings only when they have the SendPlay option.


Additionally, you don't have to press anything after you press the hotkey if you use an asterisk (*) in the options.

For example, if you were using notepad as the destination and you wanted to use the number 1 as your hotkey, try this:

SetTitleMatchMode, 2

:*:1::
  IfWinExist, Notepad
  {
    WinActivate
    SendPlay, dsaw
  }
  Else
    MsgBox, Notepad is not open

Return

You could try replacing 'Notepad' with the name (or part of the name) of your game window and see if this works for you?

If you could paste any code you have so far that isn't working, and maybe let us know the game name, maybe someone can test it to see if they can get it to work.

Good luck!

n3cr0p0t3nc3
  • Members
  • 2 posts
  • Last active: Feb 23 2009 12:03 PM
  • Joined: 19 Feb 2009
im playing guilty gear but i think it will not work.
i also play wow but i think its not good cuz its a third party program and its illigal.

OceanMachine
  • Members
  • 790 posts
  • Last active: Aug 23 2013 02:10 PM
  • Joined: 15 Oct 2007
Have you tried the above with your game window? It should work, but I don't have guilty gear so I can't check it.

Also, it's not against the world of warcraft terms of service to use a third party application to control characters, as long as you actually press keys or click the mouse (i.e. you can't get a program to control your character automatically). However, I think you have to do 1 action per key press so pressing multiple keys using a script may not be allowed.

A lot of people use AHK to broadcast key presses to multiple WoW windows to allow them to 'multibox' more easily (control multiple WoW characters at once from the same computer). This is NOT against the terms of service and is totally 'legal' in the game.

I have used AHK to send keys to WoW windows, so I don't see why it shouldn't work on any other games, but I can't test your particular game unfortunately.

If you post any code you have now that isn't working, maybe someone can help.

martis
  • Guests
  • Last active:
  • Joined: --

Have you found the window before trying to send the keys?

Also you might try using SendPlay instead of the other methods. I suggested SendPlay because of the below line in the manual.

From the AHK Manual:

SendPlay's biggest advantage is its ability to "play back" keystrokes and mouse clicks in a broader variety of games than the other modes. For example, a particular game may accept hotstrings only when they have the SendPlay option.


Additionally, you don't have to press anything after you press the hotkey if you use an asterisk (*) in the options.

For example, if you were using notepad as the destination and you wanted to use the number 1 as your hotkey, try this:

SetTitleMatchMode, 2

:*:1::
  IfWinExist, Notepad
  {
    WinActivate
    SendPlay, dsaw
  }
  Else
    MsgBox, Notepad is not open

Return

You could try replacing 'Notepad' with the name (or part of the name) of your game window and see if this works for you?

If you could paste any code you have so far that isn't working, and maybe let us know the game name, maybe someone can test it to see if they can get it to work.

Good luck!



i wont work in the game i play gunz the duel in a private server and the server is called fatal gunz do i have to turn on the ntepad when i try it do i have tu put the file into some directory? i dont know how to make it work

lilalurl.T32
  • Members
  • 391 posts
  • Last active: Jul 05 2011 03:39 PM
  • Joined: 17 May 2007

im playing guilty gear but i think it will not work.


If it is GGXX #Reload, why not use the config application to bind keys to L1 and L2. Then go to the options in-game, select the key config menu and attribute L2 to HS S K P (L2 is unused in the default button mapping and as you will see the developers thought of the various button combinations needed in-game).

I think the same thing is possible with GGX.


Anyway, here is what I had done a while ago, before of thinking of the simple built-in solution described above.

#IfWinActive ahk_class GUILTYGEAR XX #RELOAD
v::sendevent {s down}{x down}{c down}{d down}{s up}{d up}{c up}{x up}
#IfWinActive

You'll need to adapt it to your keybinds. A few times (5%), in doesn't work correctly, it presses 3 buttons instead of 4 (checked in training mode, displaying input). Never found out why.
________
HERBALAIRE

  • Guests
  • Last active:
  • Joined: --
How can I bind LMB with C in one button?