Skip to content

Repository files navigation

GodotDualsense logo

DualSense for Godot 4

Native Sony DualSense controller support for Godot 4, written in C#. It talks to the controller directly over raw HID, so a player only needs your game running, nothing else installed or configured on the side.

Tools like DualSenseX let a PC game reach adaptive triggers, the lightbar, and similar features by talking to a separate, always running background application that translates its own virtual API into real controller output. This addon skips that layer: it opens the controller's HID device itself and speaks its native report format directly from inside your game.

Features

  • Adaptive triggers: Off, Resistance, GameCube, Bow, Galloping, Weapon, MachineGun, and Machine effects, each with tunable parameters, applied independently per trigger.
  • Lightbar color and player LED pattern.
  • Mic LED.
  • Rumble.
  • Touchpad position, touch state, and finger count.
  • Gyroscope and accelerometer.
  • Battery level.
  • An editor only binding layer (DualSenseActionBinder / DualSenseActionBinding / DualSenseTriggerProfile) that maps any of the above onto a normal Godot input action, including inputs Godot's own Input API cannot reach at all (Mute, PS, Fn1/Fn2, the DualSense Edge paddles).

Standard buttons, sticks, and basic rumble already work through Godot's built in Input API on recent Godot versions (SDL3 backend). This addon does not replace that; it only adds the parts SDL does not expose.

Requirements

  • Godot 4.7 or newer, C# (.NET) enabled.
  • HidSharp 2.1.0, added as a NuGet package reference (already set up in this repository's godot_dualsense.csproj; add it to your own .csproj if you copy just the addon folder into an existing project).
  • A DualSense controller connected over USB. Bluetooth is implemented but has not been exercised against real hardware yet; see TESTING.md.

Install

Copy addons/GodotDualsense/ into your project's addons/ folder, add the HidSharp package reference to your .csproj, then enable the plugin from Project Settings > Plugins. Full usage docs live in addons/GodotDualsense/README.md.

This repository is also a small Godot project on its own (project.godot + godot_dualsense.csproj), so you can clone it and open it directly in Godot to try the addon or use it as a reference.

Status

Version 0.1, first public version. This addon has been built and partly verified against a real DualSense controller over USB during development, but plenty of it has not been explicitly re-checked yet. Read TESTING.md before relying on anything this list does not cover, especially Bluetooth and DualSense Edge specific features.

Credits / License

MIT, see LICENSE. The HID protocol implementation under addons/GodotDualsense/Protocol/ (input report parsing, output report composition, CRC32 checksum, and adaptive trigger effect encoding) is a C# port of Rafael Valoto's Dualsense-Multiplatform (MIT). Full attribution and the original license text are reproduced in LICENSE.

Releases

Packages

Contributors

Languages