Press single key for two other keys

Ask gaming related questions (AHK v1.1 and older)
Evil-e
Posts: 262
Joined: 04 Sep 2018, 11:09

Press single key for two other keys

24 Sep 2018, 13:21

OK..... I know this has been asked many times, as I have tried every example on the following search page:

https://www.google.com/search?q=autohot ... e&ie=UTF-8

To be very specific, my game is WRC FIA World Championship 1 and requires that "LAlt" be held down and then "F4" be pressed for the exit game menu to pop up (once the exit menu pops up, both keys can continue to be held down or released, it makes no difference).
I confirmed that my #IfWinActive window works, as I first bound LButton::e and the vehicle moved forward. I have tried MANY, variations of the following...

Ctrl:: Lalt & F4 <--- this obviously does not work, but rather an illustration of my goal

I tried a whole bunch of variations of script below
Ctrl::
Send, {lalt down}
KeyWait, Ctrl
Send, {F4 down}

I have another game that requires 3 keys be held for specific action, but sure that a solution to this problem will lead to solution of that one :)

Many thanks, in advance
I have a bit of experience opening and sending commands to game console and CMD.exe... just ask :)
swagfag
Posts: 6222
Joined: 11 Jan 2017, 17:59

Re: Press single key for two other keys

25 Sep 2018, 01:45

*Ctrl::Send {LAlt Down}{F4}
*Ctrl Up::Send {LAlt Up}
Evil-e
Posts: 262
Joined: 04 Sep 2018, 11:09

Re: Press single key for two other keys

25 Sep 2018, 09:25

Urgh.....

Thank you, swag. I am now using AHK v1.1.30.00, but wondering if maybe these commands require 64bit OS or just not compatible with Windows XP :(

I have tried your specific script and well over 20 variations of it, based on lots of research. I keep seeing users looking for a single key to process two others get it working with scripts that just don't work for me. I have tried
substituting Ctrl with different characters, because...... well, just because all other attempts are failing :( Hopefully, somebody will see something that I am missing or not explaining my issue correctly.

Thank you for your assistance, I will keep beating my head against this wall in the hopes that it will stop hurting... lol

Eric :)
I have a bit of experience opening and sending commands to game console and CMD.exe... just ask :)
Evil-e
Posts: 262
Joined: 04 Sep 2018, 11:09

Re: Press single key for two other keys

26 Sep 2018, 18:54

OK.... found out something interesting here

I have another game in which if you hold LShift and press the RButton... a grenade is thrown. I just now tried the following script... and works perfectly

----------------------------------------------------------------------------------------

#IfWinActive Turokahk_class LaunchUnrealUWindowsClient
XButton2::
Send {LShift down}{RButton}
Return

----------------------------------------------------------------------------------------

I copied this code to the game in question (changing keys, of course) and it does not work. My only conclusion is that there is some issue with the Alt key. I also found out that either Lalt or Ralt with F4 key will activate the exit menu. I don't
know if this is unusual, but figured I would mention it.

Eric

PS. I have taped a pillow to my forehead and the wall does not hurt nearly as much as before

EDIT: Turns out that the above script would "retain'' the LShift key as pressed after returning to Windows. script was revised to the following:

-------------------------------------------------------------------------------------------
#IfWinActive Turokahk_class LaunchUnrealUWindowsClient
XButton1::y
XButton2::
Send {LShift down}{RButton}
XButton2 up::
Send {LShift up}
Return

------------------------------------------------------------------------------------------
I have a bit of experience opening and sending commands to game console and CMD.exe... just ask :)

Return to “Gaming Help (v1)”

Who is online

Users browsing this forum: No registered users and 131 guests