Skip to content
プロジェクト

HamzaYslmn/Forza-Horizon-DualSense-Python

GitHubで見る

概要

Forza HorizonのDualSenseアダプティブトリガー

その他のプロジェクト

この数値の測り方

計測したスター増加

24時間
+2
7日間
+22
15日間
+23
1か月
履歴を収集中

期間ごとの純増数です。期間は重複しており、日別の値ではありません。未計測の値は空欄です。スター数は注目度の指標であり、品質の保証ではありません。

English • Türkçe • 日本語 • 简体中文

🏎️ Forza Horizon - DualSense Adaptive Triggers

Real trigger feedback for Forza Horizon on PC.

Feel the brakes. Feel the engine. No setup juggling.

My Steam profile: https://steamcommunity.com/id/teccno/

For CS:GO item Sponsorship :D : https://steamcommunity.com/tradeoffer/new/?partner=291638630&token=Xyg4vITU

💛 Huge thanks to Jared (jmac122) for sponsoring this project by gifting me Forza Horizon 6.


📜 Contents

  1. What it does
  2. Install
  3. In-game setup
  4. Enable Steam Haptics
  5. Run it
  6. Auto-launch with Steam
  7. Tuning the feel
  8. Troubleshooting
  9. Credits

💡 What it does

Forza Horizon sends car telemetry over UDP, but Steam Input doesn't use the DualSense's adaptive triggers. This tiny app fills the gap:

  • Left trigger (brake) — pushes back harder the more you press. Buzzes like ABS when tires slip. Extra resistance when handbraking.
  • Right trigger (throttle) — soft progressive resistance. Thumps on gear shifts. Buzzes at the rev limiter.

How it talks to your controller without fighting Steam

┌──────────────────┐    UDP 5300     ┌──────────────────┐    HID write    ┌─────────────┐
│  Forza Horizon   │ ──────────────► │  This app        │ ──────────────► │  DualSense  │
│  (Data Out)      │  telemetry      │  (trigger bits   │  triggers only  │  controller │
└──────────────────┘  324 bytes      │   only)          │                 └─────────────┘
                                     └──────────────────┘                        ▲
                                                                                 │
                                     ┌──────────────────┐    HID write           │
                                     │  Steam Input     │ ──────────────────────►│
                                     │  (rumble bits)   │  rumble + buttons      │
                                     └──────────────────┘

Both the app and Steam write to the same controller — but they touch different bytes:

  • Steam owns the rumble motors and button mapping.
  • This app only flips the adaptive trigger bits (valid_flag0 bits 0x04 and 0x08).
  • The HID device is opened in non-blocking mode, so writes fire immediately instead of waiting on the controller. Nothing gets queued, nothing blocks Steam.

That's why you can run both at the same time and neither one breaks the other.


🛠️ Install

You need: Windows 10/11 or Linux, and a DualSense controller (USB or Bluetooth).

  1. Go to the latest release.
  2. Download win_start.bat (Windows) or linux_start.sh (Linux).
  3. Put it in any empty folder.
  4. Important: I highly recommend installing uv manually first. Open PowerShell and run this command:
    powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
    
    • If you skip this, win_start.bat will try to install uv automatically. However, Windows might block this auto-install with an "Execution Policy" error in PowerShell.
    • If you get the Execution Policy error: Hold Shift + Right-Click in the folder, click "Open PowerShell window here", paste Set-ExecutionPolicy RemoteSigned -scope CurrentUser and hit Enter, then type Y and Enter.
  5. Double-click win_start.bat (or linux_start.sh).

The launcher handles downloading the app, preparing the environment, and running it. Next time you run it, it will also check for updates.

[!NOTE] A standalone Windows .exe is also attached to each release as an experimental option. The recommended way to run the app is still win_start.bat — it self-updates and works the same across every Windows version.

Linux extras: install libhidapi (sudo apt install libhidapi-hidraw0 / sudo pacman -S hidapi / sudo dnf install hidapi) and the udev rule from app/packaging/linux/70-dualsense.rules. Then unplug/replug the controller once.

GUI on Linux: X11 needs libxcb-cursor0 (sudo apt install libxcb-cursor0); Wayland works as is. On GNOME the minimize-to-tray icon needs the AppIndicator extension.

🎮 Playing with SISR (Xbox App / Windows Store users)

If you are playing the game via the Xbox App or Microsoft Store, you will need a tool that makes the game recognize your controller as an Xbox controller. One option is SISR (Steam Input System Redirector) — it redirects Steam Input to the system level and emulates a real Xbox controller, so it works even with Windows Store apps and anti-cheat-protected games.

Because SISR routes the controller through Steam Input, Steam can grab the physical DualSense exclusively and prevent this app from connecting. To avoid this, you must start the programs in this exact order:

  1. First, launch THIS APP (win_start.bat) and wait for the short pulse on the triggers.
  2. Second, launch SISR (and Steam).
  3. Finally, launch Forza Horizon.

(Note: If your controller disconnects while playing, close SISR, restart this app, then open SISR again. For SISR setup and emulation options, see the SISR README.)

Manual install (for developers)
git clone https://github.com/HamzaYslmn/Forza-Horizon-DualSense-Python
cd Forza-Horizon-DualSense-Python/src
uv sync
uv run main.py

Need uv? pip install uv or astral.sh/uv.


🎯 In-game setup

In Forza Horizon, open Settings → HUD and Gameplay and scroll to the bottom:

Setting Value
Data Out ON
Data Out IP Address 127.0.0.1
Data Out IP Port 5300

[!NOTE] The app listens on System → Data Out IP Address (default 127.0.0.1). If 127.0.0.1 doesn't work in your Forza, write ::1 (IPv6) in both places. Forza on another PC: set the app to 0.0.0.0 (or :: for IPv6 too) and enter this PC's network IP in Forza.

English Settings   Turkish Settings


🔊 Enable Steam Haptics

Steam can vibrate the left and right rumble motors on your DualSense controller. To enable them:

In Steam:

  1. Right-click Forza Horizon in your library → Properties.
  2. Go to Controller → Additional Settings.
  3. Make sure DualSense vibration is turned ON.

In-game (Forza Horizon):

  1. Open Settings → Advanced Controls.
  2. Find the Vibration option and enable it.

DualSense software:

For best results, install the official PlayStation® Accessories software:

This ensures your DualSense firmware is up to date for windows.

ℹ️ About Adaptive Triggers: Steam doesn't support DualSense adaptive triggers for this game. That's what this app does — it adds realistic trigger feedback (brake resistance, engine feedback, ABS pulses, gear thumps, rev limiter buzz) on top of the rumble that Steam provides.


▶️ Run it

Double-click win_start.bat (Windows) or linux_start.sh (Linux).

You'll feel a short pulse on both triggers — that means it's working. Now launch Forza Horizon and drive.

Start the launcher before Forza Horizon. If you use HidHide, allowlist python.exe.


🎮 Auto-launch with Steam

Want the triggers to turn on automatically when you press Play? Tell Steam to run the launcher first.

⚠️ Warning: Sometimes auto-launching this way can cause issues with the application. For the most stable experience, it is recommended to launch the app manually by double-clicking the script.

  1. In Steam, right-click Forza Horizon → Properties.

  2. Open the General tab and find Launch Options.

  3. Choose one of the following commands based on your preference (change the path to where your win_start.bat actually is):

    • Option A: Keeping Steam Overlay & Playtime Tracking (Recommended) This wraps the script in cmd.exe /c so Steam can properly monitor the process, keeping your Steam Overlay (Shift+Tab) and Playtime Tracking fully functional while automatically closing the console window afterwards:

      "C:\Windows\System32\cmd.exe" /c ""C:\Your\Path\To\Forza-Horizon-DualSense-Python\win_start.bat" %command%"
      
    • Option B: Simpler Method A direct way to launch, though the Steam Overlay and playtime tracking may stop working:

      "C:\Your\Path\To\Forza-Horizon-DualSense-Python\win_start.bat" %command%
      

That's it. Press Play - the launcher runs, then the game opens.

Steam launch options

Advanced — run the Python script directly (no BAT file)

If you cloned the repo and use uv, paste this into Launch Options instead:

cmd /c "start /MIN /D C:\Your\Path\To\Forza-Horizon-DualSense-Python\src uv run main.py" && %command%

🎚️ Tuning the feel

Every effect (brake force, ABS buzz, gear thump, rev limiter, etc.) can be tweaked or turned off from the Settings page in the app — no file editing needed. Changes apply on next launch.

The redline is learned per car (where Forza cuts power at full throttle), so the redline buzz and the shift lights need no per-car tweaking.


🩺 Troubleshooting

Symptom Fix
DualSense gamepad interface not found Controller not connected, or HidHide is hiding it — allowlist python.exe.
No UDP packets yet Forza's Data Out is off, IP/port is wrong, Windows Firewall is blocking, or try ::1 instead of 127.0.0.1 (in Forza and in the app's System tab).
Windows Defender / SmartScreen blocks win_start.bat 1. On the blue "Windows protected your PC" screen, click "More info".
2. Click the "Run anyway" button that appears at the bottom. (The script only downloads required dependencies.)
Triggers feel weak Raise brake_max_force / throttle_max_force, or lower the matching curve.
Triggers feel like a brick wall Lower brake_max_force / throttle_max_force, or raise the matching curve.
Triggers feel stiff at a light press Lower the baseline force, or raise the curve.
No vibration on gear shift Car must be moving faster than 3 km/h and changing between valid gears.
Console window is blank after the startup pulse Run from a terminal with cd src && uv run main.py --headless to skip the TUI.

📁 Project layout

src/
├── main.py                         # Entry point
└── modules/
    ├── config/settings.py          # 👈 the file you edit
    ├── session.py                  # backend start / stop (GUI, TUI, --headless)
    ├── loop.py                     # per-packet loop
    ├── dualsense/
    │   ├── device.py               # HID layer
    │   ├── adaptive_trigger.py     # generic trigger effect primitives
    │   └── haptics.py              # game sound -> haptic actuators
    ├── forzahorizon/
    │   ├── telemetry.py            # UDP telemetry parser
    │   ├── trigger_effects.py      # Forza-aware trigger effects
    │   └── game_watch.py           # exit when the game closes
    ├── dsx/                        # DSX mode
    └── gui/, tui/                  # window (Qt) / terminal (Textual)

🎮 DSX Support

I have integrated DSX (DualSenseX) support. Due to DSX limitations, you might not get the exact 1:1 experience, but I have done my best. A lower-fidelity version of the adaptive trigger effects is fully supported.

DSX Configuration

To use it: in DSX open Settings → Networking → Mod system, turn on incoming UDP and Let mods control adaptive triggers; in this app turn on System → DSX integration. The port is read from DSX automatically. If triggers don't react, the Logs tab says why (for example a DSX switch that is off).


🎧 Haptics

Feel the game's sound in your hands while you race, over USB or Bluetooth. Turn it on in Controls → Haptics; set the strength (up to 500%) in Settings.

  • Your speaker volume doesn't matter: 100% is the game's full sound.
  • When Forza vibrates, you feel Forza instead: the controller plays one at a time.
  • Everything your speakers play during a race comes through, music and voice chat too. Linux needs PulseAudio or PipeWire (over USB: the controller's 'Analog Surround 4.0' profile). macOS can't capture game sound.

💡 Lights

In Controls → Lights:

  • Shift lights: the lightbar turns from green to red as the revs climb, the player LEDs fill up like a rev bar, and both blink at the rev limiter. The app learns each car's real limiter (where Forza cuts power at full throttle), so the redline buzz fires at the right rpm too.
  • ABS light: the mic LED blinks with the ABS rumble.

Brightness is in Settings → Lights. In DSX mode DSX keeps the lights.


🙏 Credits

Built by HamzaYslmn.

💛 Sponsors

A heartfelt thank you as well to the anonymous sponsors who quietly supported this project, and to everyone whose appreciation, kind words, and social media shares helped keep me motivated throughout the journey.

📜 Third-party licenses

The window UI uses Qt for Python (PySide6) by The Qt Company, licensed under the GNU LGPL v3. PySide6 is used unmodified. The launcher bundle installs it from PyPI on first run; the standalone binaries include it, and you can rebuild them against any compatible PySide6 version from this repository's source (packaging/). Other dependencies keep their own licenses (see src/pyproject.toml).


Built for an immersive racing experience

関連プロジェクトを探す

読み込み中…