Assetto Corsa

Assetto Corsa

48 ratings
Full controller support
By mucusSTfriend
This guide adds menu controls and pause button on your gamepad.
   
Award
Favorite
Favorited
Unfavorite
Introduction
I did not like using external utilities but it is necessary for a gamepad controlled enviroment. Now I am in love with JoyToKey and my 360 gamepad in my living room pc.
This guide is for an Assetto Corsa profile. On a 360 gamepad it makes the right stick behave as mouse, RB as left click and START as Escape.
Installation
You need a text editor, like notepad, and JoyToKey, which is available at official page[joytokey.net]. There is no installer, just unzip and run the program to create an empty profile. Open notepad, paste the script below and save as "ACorsa.cfg" in the same folder as JoyToKey. Your game now has full controller support.
JoyToKey profile
[General]
FileVersion=56
NumberOfJoysticks=1
NumberOfButtons=8
DisplayMode=2
UseDiagonalInput=0
UsePOV8Way=0
Threshold=20
Threshold2=250
KeySendMode=0
SoundFile=

[Joystick 1]
Button08=1, 1B:00:00:00, 0.000, 0, 0 ##Escape (pause)
Axis3n=2, -10, 0, 0, 0, 0, 0, 0.000, 0, 95, 5.0, 100, 0, 0, 0 ##Mouse left
Axis3p=2, 10, 0, 0, 0, 0, 0, 0.000, 0, 95, 5.0, 100, 0, 0, 0 ##Mouse right
Axis4n=2, 0, -10, 0, 0, 0, 0, 0.000, 0, 95, 5.0, 100, 0, 0, 0 ##Mouse up
Axis4p=2, 0, 10, 0, 0, 0, 0, 0.000, 0, 95, 5.0, 100, 0, 0, 0 ##Mouse down
Button06=2, 0, 0, 0, 1, 0, 0, 0.000, 0, 95, 1.0, 100, 0, 0, 0 ##Mouse left click
Switching profiles automatically
You do not want your gamepad to behave like that all the time, so you need to tell JoyToKey to switch profiles automatically. Go to Settings, Associate profiles with applications. Click "Specify a default profile" and select an empty one, like the default. Now you gamepad will behave normally outside of Assetto Corsa.
Click on "Add". "Application Name" does not matter, "Assetto Corsa" is fine.
In "applcation path" you must enter the game's exe path, which is something like "C:\Program Files (x86)\Steam\steamapps\common\assettocorsa\AssettoCorsa.exe".
In "Associated Profile" specify the one you created before, which in my example is ACorsa. Now your profile works in the launcher.
To make it work in the race too, add another association and repeat the same steps except in "applcation path" you must point to "acs.exe" instead of "AssettoCorsa.exe".
Conclusion
Steam Big Picture has essentially turned my PC into a very powerfull console while gaming. Until SteamOS overcomes Windows, an external utility is needed to control the operating system with a gamepad. I prefer JoyToKey because it switches profiles automatically. I have an empty profile (very imprortant), a generic one for navigating Windows, one for browsing the Internet and one for every game that does not have full controller support. I chose JoyToKey but I am always open to suggestions. The guide is not totally noob friendly (no pictures!) because I think it is clear enough but I can provide clarifications if needed.
Bonus AHK
I also created an Autohotkey profile but it is very primitive since I decided to stick to JoyToKey.

;I downloaded JoystickMouse.ahk script from the official Autohotkey site and modified it to work in Assetto Corsa. It assigns my 360 gamepad's right stick to mouse movement, RB to left click, START to Escape.
;[WIP] (1) Make the script run only with the game (2) make an unpause button

; Increase the following value to make the mouse cursor move faster:
JoyMultiplier = 0.30

; Decrease the following value to require less joystick displacement-from-center
; to start moving the mouse. However, you may need to calibrate your joystick
; -- ensuring it's properly centered -- to avoid cursor drift. A perfectly tight
; and centered joystick could use a value of 1:
JoyThreshold = 20

; Change the following to true to invert the Y-axis, which causes the mouse to
; move vertically in the direction opposite the stick:
InvertYAxis := false

; Change these values to use joystick button numbers other than 1, 2, and 3 for
; the left, right, and middle mouse buttons. Available numbers are 1 through 32.
; Use the Joystick Test Script to find out your joystick's numbers more easily.
ButtonLeft = 6

; If your system has more than one joystick, increase this value to use a joystick
; other than the first:
JoystickNumber = 1

; END OF CONFIG SECTION -- Don't change anything below this point unless you want
; to alter the basic nature of the script.

#SingleInstance

JoystickPrefix = %JoystickNumber%Joy
Hotkey, %JoystickPrefix%%ButtonLeft%, ButtonLeft

; Calculate the axis displacements that are needed to start moving the cursor:
JoyThresholdUpper := 50 + JoyThreshold
JoyThresholdLower := 50 - JoyThreshold
if InvertYAxis
YAxisMultiplier = -1
else
YAxisMultiplier = 1

SetTimer, WatchJoystick, 10 ; Monitor the movement of the joystick.


return ; End of auto-execute section.


; The subroutines below do not use KeyWait because that would sometimes trap the
; WatchJoystick quasi-thread beneath the wait-for-button-up thread, which would
; effectively prevent mouse-dragging with the joystick.

ButtonLeft:
SetMouseDelay, -1 ; Makes movement smoother.
MouseClick, left,,, 1, 0, D ; Hold down the left mouse button.
SetTimer, WaitForLeftButtonUp, 10
return

WaitForLeftButtonUp:
if GetKeyState(JoystickPrefix . ButtonLeft)
return ; The button is still, down, so keep waiting.
; Otherwise, the button has been released.
SetTimer, WaitForLeftButtonUp, off
SetMouseDelay, -1 ; Makes movement smoother.
MouseClick, left,,, 1, 0, U ; Release the mouse button.
return

WatchJoystick:
MouseNeedsToBeMoved := false ; Set default.
SetFormat, float, 03
GetKeyState, joyU, %JoystickNumber%joyU
GetKeyState, joyr, %JoystickNumber%joyr
if joyU > %JoyThresholdUpper%
{
MouseNeedsToBeMoved := true
DeltaX := joyU - JoyThresholdUpper
}
else if joyU < %JoyThresholdLower%
{
MouseNeedsToBeMoved := true
DeltaX := joyU - JoyThresholdLower
}
else
DeltaX = 0
if joyr > %JoyThresholdUpper%
{
MouseNeedsToBeMoved := true
DeltaY := joyr - JoyThresholdUpper
}
else if joyr < %JoyThresholdLower%
{
MouseNeedsToBeMoved := true
DeltaY := joyr - JoyThresholdLower
}
else
DeltaY = 0
if MouseNeedsToBeMoved
{
SetMouseDelay, -1 ; Makes movement smoother.
MouseMove, DeltaX * JoyMultiplier, DeltaY * JoyMultiplier * YAxisMultiplier, 0, R
}
return
;___________________
;
joy8::Send {Esc}
Bonus AM
I recently switched to Antimicro. It is open source and more promising than any commercial software
<?xml version="1.0" encoding="UTF-8"?>
<gamecontroller configversion="14" appversion="2.10.1">
<!--The SDL name for a joystick is included for informational purposes only.-->
<sdlname>X360 Controller</sdlname>
<!--The GUID for a joystick is included for informational purposes only.-->
<guid>00000000000000000000000000000000</guid>
<names>
<buttonname index="7">Pause</buttonname>
<buttonname index="11">Select</buttonname>
<controlstickname index="2">Mouse</controlstickname>
</names>
<sets>
<set index="1">
<stick index="2">
<stickbutton index="5">
<slots>
<slot>
<code>2</code>
<mode>mousemovement</mode>
</slot>
</slots>
</stickbutton>
<stickbutton index="3">
<slots>
<slot>
<code>4</code>
<mode>mousemovement</mode>
</slot>
</slots>
</stickbutton>
<stickbutton index="1">
<slots>
<slot>
<code>1</code>
<mode>mousemovement</mode>
</slot>
</slots>
</stickbutton>
<stickbutton index="7">
<slots>
<slot>
<code>3</code>
<mode>mousemovement</mode>
</slot>
</slots>
</stickbutton>
</stick>
<button index="7">
<actionname>Escape</actionname>
<slots>
<slot>
<code>0x1000000</code>
<mode>keyboard</mode>
</slot>
</slots>
</button>
<button index="11">
<actionname>Left click</actionname>
<slots>
<slot>
<code>1</code>
<mode>mousebutton</mode>
</slot>
</slots>
</button>
</set>
</sets>
</gamecontroller>
16 Comments
mucusSTfriend  [author] 29 Feb, 2020 @ 7:24am 
I am sorry, I no longer use JoyToKey. Steam API works fine for my generic controllers.
tecleanu 25 Feb, 2020 @ 11:40am 
Hi. I hope you can help. I have a generic controller (gamesir) It used to work perfect then suddenly it stopped working. Even though the game recognizes the controller and pushing buttons changes values, in-game inputs do nothing. Using the controller as a "custom" seem to work but the hand movement is incredibly quick and the car is impossible to drive, It also feels numb, like having tc and abs fully on.
Thank you
Gr1M55 27 Oct, 2018 @ 7:53am 
i need to know xd
mucusSTfriend  [author] 27 Oct, 2018 @ 7:22am 
"Automatic gearbox" setting is in Realism tab. It is not affected by this guide.
Gr1M55 27 Oct, 2018 @ 5:14am 
how to turn off automatic gear ??
Scott 27 Apr, 2017 @ 11:13am 
thanks
mucusSTfriend  [author] 27 Apr, 2017 @ 11:07am 
Yes. If you mean game's preset, you can do it in Assetto Corsa. If you mean mine, you can do it in whichever program you selected.
I have quit this method. Steam has provided support for such circumstances. I will upload my steam controller profile.
Scott 26 Apr, 2017 @ 5:51pm 
: is it possible to remap my xbox 360 controller if i dont like the presets?
mucusSTfriend  [author] 28 Dec, 2016 @ 12:57pm 
You can run JoyToKey from any folder. The same applies for its profiles.
Danilicius 28 Dec, 2016 @ 10:22am 
do I have to unzip JoyToKey to Assetto Corsa directory? and then do I need upload a profile into this app or just leave it in the same folder?