Skip to content

Add support for joypad triggers vibration#116214

Draft
Nintorch wants to merge 1 commit into
godotengine:masterfrom
Nintorch:joypad-trigger-rumble
Draft

Add support for joypad triggers vibration#116214
Nintorch wants to merge 1 commit into
godotengine:masterfrom
Nintorch:joypad-trigger-rumble

Conversation

@Nintorch
Copy link
Copy Markdown
Member

@Nintorch Nintorch commented Feb 12, 2026

Requires #116055 to be merged first.

This functionality has been split from #107967 and adjusted to the new advanced joypad features system.

This PR adds the ability to use Xbox One controller's trigger rumble. Note that on Windows it's not possible to use the HIDAPI driver for Xbox controller (even if we set the corresponding environment variable to 1) and trigger rumble is not available in DirectInput or XInput, that's why WGI or GameInput are required for this PR.

I tested this PR in my fork with GameInput and it seems to be working!

I don't have a DualSense controller, but personally it feels like trigger rumble might work quite similarly to adaptive triggers if used correctly, so it might make sense to implement it alongside #111682 , see also godotengine/godot-proposals#12087 .

TODO:

  • Test if this PR works for Xbox Series X/S controllers (I don't have one :( )
  • Mark as available for iOS
  • Fix "indefinite" vibration text in docs
  • Check for joystick capability instead of gamepad type

Comment thread doc/classes/Input.xml
<return type="bool" />
<param index="0" name="device" type="int" />
<description>
Returns [code]true[/code] if the joypad has triggers vibration (trigger rumble).
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Returns [code]true[/code] if the joypad has triggers vibration (trigger rumble).
Returns [code]true[/code] if the joypad has triggers vibration (trigger rumble). Not to be confused with DualSense's adaptive triggers.

}

bool JoypadSDL::Joypad::has_joy_triggers_vibration() const {
return SDL_GetGamepadTypeForID(sdl_instance_idx) == SDL_GAMEPAD_TYPE_XBOXONE;
Copy link
Copy Markdown
Member Author

@Nintorch Nintorch Apr 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I should probably check here if SDL_RumbleJoystickTriggers doesn't return an error, and if it does, trigger vibration is not supported.

EDIT: Just remembered there should be a joystick property for that similarly to how we check for LED support.

@Nintorch Nintorch marked this pull request as draft April 15, 2026 04:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants