Forum

VL.GameController

This is a work in progress to support plug+play of SDL GameControllers.

SDL device list:
https://raw.githubusercontent.com/gabomdq/SDL_GameControllerDB/master/gamecontrollerdb.txt

v.0.4
  • added LeftStick, RightStick, Trigger nodes
  • added operation to download latest SDL mapping file
  • fixed .Internal nodes being red in newer vvvv versions
    -cleanup, comments
v.0.3
  • may still have issues with reversed axes for some devices

So, does it work for your dusty, old controllers?

Adding new devices or changing the mapping now works by editing the file mappings/sdl_mappings_windows_overwrite.txt
For the GUID you need to include the vendor and product ID of the new device.

Adding new devices should rarely be necessary, so first check if the device is in the list and test how it is working here:
https://gamepad-tester.com/

v.0.2

Right now, when plugging in a new device, the device model is guessed by the name that Stride outputs.
The names do not always give enough information to confidently determine the correct device.

For example, the PS5 DualSense appears just as ‘Wireless Controller’,
while the PS4 DualShock is helpfully recognized as ‘PS4 Controller’.

The mappings folder contains the button and axis mappings for currently supported devices:
PS4 DualShock, PS5 Dual Sense, Xbox360, Nintendo JoyCon, and a 100 year old Logitech Dual Action.

Adding new device mappings could be more convenient, for now it works by adding a .txt file and rearranging the entries. Use the Help file to see the direct input values.

Things that could be improved or added:

  • per controller deadzone
  • set vibration
  • PS touchpad position XY
  • read gyro
  • 2 Joy-Cons can not be recognised as one controller
  • Joy-Con ThumbStick only recognised as digital (driver related)
  • Xbox home button missing
  • battery status
  • set PS lights

Hope someone will find this useful or wants to help out.
Have fun!

VL.GameController.v0.4.zip (319.5 KB)

8 Likes

EDIT:

  • SDL mapping solved with v0.3
  • still no vibration support

Still confused by Stride’s separation between GamePad and GameController, and why VL does only detect the latter.

I guess GameController seems to be the more generic Joystick input from SDL,
whereas GamePad is supposed to cover all Xbox-like controllers.

As a test, I am now getting the product and vendor numbers using HidLibrary, but Stride seems to already handle this for SDL GamePads:

I guess it would help with device detection and mapping to get the GamePad working in vvvv instead of GameController.

Vibration
In Stride.Input/SDL/GamePadSDL.cs it reads " // No vibration support in SDL gamepads"
SDL seems to support vibration since last year:

SDL