Announcement

Collapse
No announcement yet.

SDL2 Gets Better Support For Xbox / PS4 / Nintendo Switch Pro Controllers

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • SDL2 Gets Better Support For Xbox / PS4 / Nintendo Switch Pro Controllers

    Phoronix: SDL2 Gets Better Support For Xbox / PS4 / Nintendo Switch Pro Controllers

    Sam Lantinga of Valve has contributed better support for some popular game controllers to the SDL2 library...

    http://www.phoronix.com/scan.php?pag...ystick-Drivers

  • #2
    That's a huge commit and a great addition to SDL. Valve are doing great things for GNU/Linux gaming.

    Comment


    • #3
      SDL2 has the same PS4 controller driver as in https://github.com/torvalds/linux/bl...hid/hid-sony.c kernel driver?

      Comment


      • #4
        Slightly OT: Does anyone know if it's possible to use multiple mice (each with its own cursor) with sdl2? Ryan Gordon had a library called "ManyMouse" that allowed exactly that. If i remember correctly they wanted to implement something like that into sdl2.

        Comment


        • #5
          Great stuff, well done.

          Comment


          • #6
            Originally posted by WebMac View Post
            Slightly OT: Does anyone know if it's possible to use multiple mice (each with its own cursor) with sdl2? Ryan Gordon had a library called "ManyMouse" that allowed exactly that. If i remember correctly they wanted to implement something like that into sdl2.
            Given that that the MPX (Multi-Pointer X) extension is in mainline X11 and Microsoft offers tech demos for similar multi-mouse functionality, it really would be nice if SDL could provide a portable way to support things like the split-screen two-player mode of Amiga Lemmings on modern PCs. (I have no idea whether Apple supports such functionality but, even then, it should be possible if the application can detach the kernel driver and implement its own USB HID driver for the secondary input devices.)

            As I remember, there are either three or four things you need to usably get multiple cursors on X11-based systems, depending on how you use them:
            1. The xinput create-master command to create a new top-level keyboard/mouse node
            2. The xinput reattach command to map physical devices to it
            3. An MPX-aware window manager, if you want each cursor to have its "active window" tracked independently
            4. An application which uses XInput2's extended metadata to associate each event with a specific cursor... though this may not be necessary. (eg. if you're using an MPX-aware WM and each user has their own window to poke at.)
            I'm not sure whether I ever tested that with a compositing but MPX-unaware WM though.

            Also, running xinput with no arguments will show you your current input device tree. Here's what mine looks like:
            Code:
            [email protected] ~ % xinput
            ⎡ Virtual core pointer                          id=2    [master pointer  (3)]
            ⎜   ↳ Virtual core XTEST pointer                id=4    [slave  pointer  (2)]
            ⎜   ↳ Logitech USB Gaming Mouse                 id=8    [slave  pointer  (2)]
            ⎜   ↳ ATI Remote Wonder II                      id=9    [slave  pointer  (2)]
            ⎜   ↳ Wacom BambooFun 6x8 stylus                id=10   [slave  pointer  (2)]
            ⎜   ↳ Wacom BambooFun 6x8 eraser                id=13   [slave  pointer  (2)]
            ⎜   ↳ Wacom BambooFun 6x8 cursor                id=14   [slave  pointer  (2)]
            ⎜   ↳ Wacom BambooFun 6x8 pad                   id=15   [slave  pointer  (2)]
            ⎣ Virtual core keyboard                         id=3    [master keyboard (2)]
                ↳ Virtual core XTEST keyboard               id=5    [slave  keyboard (3)]
                ↳ Power Button                              id=6    [slave  keyboard (3)]
                ↳ Power Button                              id=7    [slave  keyboard (3)]
                ↳ bttv IR (card=34)                         id=11   [slave  keyboard (3)]
                ↳ AT Translated Set 2 keyboard              id=12   [slave  keyboard (3)]
            Last edited by ssokolow; 08-10-2018, 01:46 PM.

            Comment


            • #7
              Originally posted by ssokolow View Post
              (I have no idea whether Apple supports such functionality but, even then, it should be possible if the application can detach the kernel driver and implement its own USB HID driver for the secondary input devices.)
              You don't want to do that. It sounds easier than it is, at least, if you don't exclude touchpads and trackpoints.

              Comment


              • #8
                Originally posted by Tomin View Post

                You don't want to do that. It sounds easier than it is, at least, if you don't exclude touchpads and trackpoints.
                That's why I said "secondary devices". In my experience, the only time people have a touchpad that's not built into a laptop as the primary device, it's an Apple Magic Trackpad, the primary device on their desktop, and the only external trackpad they own.

                I know I saw a handheld external trackpoint intended for presenters in a catalogue back in the 90s, but I've drawn a complete blank in my attempts to find any evidence of such things so I can buy a device of that type as an "I've always wanted one of these" sort of thing. (I also own a Logitech Trackman Marble which I was lucky enough to have given to me.)

                I could see supporting only traditional mice for secondary players going down better than requiring XInput-compatible game controllers to reach the maximum number of supported players, which some games do.

                Comment

                Working...
                X