Jump to content
LaunchBox Community Forums

Hot Wheels King of the Road : Gas Button


latin625

Recommended Posts

I am trying to get the space key on my xarcade to register as UP arrow on Hot Wheels King of the Road and cant seem to get it going.

This is my script.  It works!  when I test it on notepad and stuff I get the cursor going up with each space key press.  But when I am playing the game, only the up arrow on the keyboard works and give it gas.

Any ideas?

Left, right works too.

#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn  ; Enable warnings to assist with detecting common errors.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.



#SingleInstance Force
Space::SendInput, {Up}  ; Press 2x for Boost/ just pressing will give Gas

 

Link to comment
Share on other sites

Thanks @JoeViking245.

  I tried both and they work, kinda... The pressing (pressing up and down) of the space key send the click, but does not detect just pressing down like you would with the keyboard UP key for gas.

A double tap of the space or UP key does Turbo boost.  Single tap or press give acceleration / gas only.

Trying to get the space key to act like the up arrow when pressed down only to give gas, the double tap seems to be 100% good.  Ill keep tinkering and see what I get. 

I see AHk offers something called  Send longpress

Edited by latin625
Link to comment
Share on other sites

10 hours ago, latin625 said:

Thanks @JoeViking245.

  I tried both and they work, kinda... The pressing (pressing up and down) of the space key send the click, but does not detect just pressing down like you would with the keyboard UP key for gas.

A double tap of the space or UP key does Turbo boost.  Single tap or press give acceleration / gas only.

Trying to get the space key to act like the up arrow when pressed down only to give gas, the double tap seems to be 100% good.  Ill keep tinkering and see what I get. 

I see AHk offers something called  Send longpress

If it works without the setkeydelay, go ahead and leave that out.

 

See if this does anything different for you.  You may need to adjust the Sleep timer.

Space::
while (getkeystate("space","p"))
{
  send, {up down}
  sleep 100
}
send {up up}
Return

 

Long press in AHK isn't a feature perse.  But when using KeyWait in your hotkey script, you can make a key essentially have dual purpose.

Example: Press and hold (aka long press) b to type out "BigBox". Otherwise press (and release) b to type "b".

$b::                ;$ is required for "Send, b"
{
  KeyWait, b, T1    ;T1 = 1 second
  if (ErrorLevel)
  {
    Send, BigBox
    Sleep, 500      ;Sleep needed so it doesn't auto repeat
  }
  Else
  {
    Send, b
    Return
  }
}

 

 

  • Unusual Gem 1
Link to comment
Share on other sites

Super Thanks!!!!!!!!

It worked!  Now I tried to copy and paste the code again to make it work the same way for player 2 using the "2" key on the keypad. This let's player 2 do the same as player one with the gas and boost.

Do I need to encapsulate the remap?  Didnt work for me when I tried to use player 2.

#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn  ; Enable warnings to assist with detecting common errors.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.



#SingleInstance Force

Space::
while (getkeystate("space","p"))
{
  send, {up down}
  sleep 100
}
send {up up}
Return



q::
while (getkeystate("q","p"))
{
  send, {2 down}
  sleep 100
}
send {2 2}
Return

 

Link to comment
Share on other sites

1 minute ago, latin625 said:

What is the P for in the line below?  Is it a pause command?

while (getkeystate("space","p"))

"Press[ed]" I think.  As in While the {space bar} is pressed.

Your 2nd 2 last line (for player 2) should be 

send {2 up}
Return

I  believe.  I'm not at my main PC right now to test/confirm.

  • Thanks 1
Link to comment
Share on other sites

No joy.

Gonna tinker a bit with it.  Cant get the Q key to send numpad2 .  I am running it separate from the other because I am not sure how to add it to the original script you sent me. It sends it on notepad and I see the number 2, but in the game nothing.  I have to press the physical numpad 2 key to give player two gas.

q::
while (getkeystate("q","p"))
{
  send, {2 down}
  sleep 100
}
send {2 up}

Return

 

Link to comment
Share on other sites

Still nothing.

Just wont register.

#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn  ; Enable warnings to assist with detecting common errors.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.




a::
while (getkeystate("a","p"))
{
  send, {Numpad2 down}
  sleep 100
}
send {Numpad2 up}

Return

 

Link to comment
Share on other sites

No joy with the suggestion. i might have to live with it being a one player game for now.

Everything looks right but doesnt work as expected. Ill keep tinkering ans seeing what is what.  Thanks for the help !!!!

my latest attempt:

#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn  ; Enable warnings to assist with detecting common errors.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.



#SingleInstance Force

l::
while (getkeystate("l","p"))
{
  send, {Numpad2 down}
  sleep 100
}
send {Numpad2 up}

Return

 

Link to comment
Share on other sites

  • 5 months later...

Did you ever get this sorted out? I just installed the game and I get no response from any source for the gas button, regardless of Xinput or Dinput settings in the TP interface. If I use Dinput I can get into the test menu but nothing is registering as a control input to calibrate. I've tried Xbox controllers too with Xinput and nothing. Not using any ahk script, just the control binding in the TP setup.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...