mdqinc / sdl_gamecontrollerdb Goto Github PK
View Code? Open in Web Editor NEWA community sourced database of game controller mappings to be used with SDL2 Game Controller functionality
Home Page: http://libsdl.org
License: zlib License
A community sourced database of game controller mappings to be used with SDL2 Game Controller functionality
Home Page: http://libsdl.org
License: zlib License
I noticed the mappings for my controller PS3 Dualshock 3 Sixaxis were incorrect, so I went to map them, however the mapping with the UUID it has already exists.
Should I make a PR to overwrite the old mapping?
The mapping should be
030000004c0500006802000000000000,PS3 Dualshock SixAxis,platform:Windows,a:b2,b:b1,x:b3,y:b0,back:b9,guide:b12,start:b8,leftstick:b10,rightstick:b11,leftshoulder:b6,rightshoulder:b7,dpup:h0.1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,leftx:a0,lefty:a1,rightx:a2,righty:a5,lefttrigger:a3~,righttrigger:a4~,
`
But it is instead
030000004c0500006802000000000000,PS3 Controller,a:b14,b:b13,back:b0,dpdown:b6,dpleft:b7,dpright:b5,dpup:b4,guide:b16,leftshoulder:b10,leftstick:b1,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b11,rightstick:b2,righttrigger:b9,rightx:a2,righty:a3,start:b3,x:b15,y:b12,platform:Windows,
Right now, there is no entry that indicates whether a controller has an xbox or playstation style layout. This however is very important to choose correct button defaults for that controller, mainly the X button for action on a playstation controller vs. the A button for action on an xbox layout.
Therefore, I would propose to add such an info entry. E.g. something like "mainbutton:a" (xbox-style), "mainbutton:x" (playstation style) or similar.
(unless I'm misunderstanding the db entries and this is already taken care of in some way I can't see)
Edit: if the db is already done in a way that the playstation's main "X" is actually stored as "A" button to make it all xbox-style to ensure the correctly positioned buttons are used, then some label info would be nice (like a:b0:X or something) so I can display what the controller actually has as a button name there - of course I can always ask the user for that, but that's not the point of having this database is it?
This mapping for my joystick UCOM UC-JS704C if you like to add to the list, i tested it in Windows8 and RetroPie on RaspBerryPie 1 Model B, using Love2D game
45130010000000000000504944564944,Generic USB Joystick,a:b0,b:b1,x:b2,y:b3,back:b8,start:b9,leftstick:b10,rightstick:b11,leftshoulder:b4,rightshoulder:b5,dpup:h0.1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:b6,righttrigger:b7,platform:Windows,
My computer and raspi too detected it as "Generic USB Joystick"
A few gamepads are already defined in SDL 2.04's source (in src/joystick/SDL_gamecontrollerdb.h
).
It might be worth writing a script that removes the relevant lines from the DB.
I’ve been doing some more digging into support for the newer Xbox Wireless Controller on macOS, and a patch recently landed in SDL2 itself adding support, and a mapping, for it (albeit with the new GUID format mentioned in #110)
This now makes me wonder, is this database intended to include or enhance the built-in mappings? Is it intended that support be maintained to add mapping support to older versions of SDL?
Android uses first 16 bytes of controller name as guid, so i suggest to add converted controller database for android platform (have not tested yet):http://pastebin.com/Jrb6kB0d
This is a conversion script that can be used to update list:
http://pastebin.com/SKj4hXFQ
If anyone have controllers conneted to android device, please test it.
This is not an issue, but I'm not familiar with where I should post SDL related topics and apologize if this is an inconvenience to anyone.
I've tested a PS4 controller on my Android phone (API 16) recently and the GUID and the format is:
"576972656C65737320436F6E74726F6C,PS4 Controller,a:b1,b:b17,back:b16,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b7,leftshoulder:b3,leftstick:b4,lefttrigger:b9,leftx:a0,lefty:a1,rightshoulder:b18,rightstick:b6,righttrigger:a10,rightx:a2,righty:a5,start:b5,x:b0,y:b2,Android"
I'm not familiar with how Android generates controller GUID but would like to verify that it's consistent across various API levels. If there's someone else out there with a PS4 controller and Android phone that can verify that it generates same GUID would be helpful.
Hello,
A while ago, I gave a mapping for the Mad Catz Fightpad SFxT (Street Fighter x Tekken) controller.
I hadn't used mine in a while, tried it again today and noticed that some buttons were not mapped correctly (e.g. the right trigger, which is implemented as a button on the controller, is now recognized as a button and not an axis as before). I'm not sure if there have been changes in SDL2 or the kernel or whatever (I'm on Ubuntu MATE 18.10) that explains this. The buttons that changed are Start (b7 → b9), Guide (b8 → b10), Back (b6 → b8), Left Trigger (a2 → b6) and Right Trigger (a5 → b7).
Here is an updated mapping:
03000000ad1b00002ef0000090040000,Mad Catz Fightpad SFxT,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,start:b9,x:b2,y:b3,platform:Linux,
Hi!
The database currently contains this entry:
060000004c0500006802000000010000,PS3 Controller (Bluetooth),[...],platform:Linux,
I think that the second character (6) in this line is wrong, and that the correct GUID should be 050000004c0500006802000000010000. Here's why:
On Linux, SDL simply computes the GUID by concatenating the bustype, vendor, product and version of the input device (plus some byte-order swapping). [0]
After connecting my PS3 controller via Bluetooth, I get this:
alexander@shepard:~$ grep . /sys/class/input/js0/device/id/*
/sys/class/input/js0/device/id/bustype:0005
/sys/class/input/js0/device/id/product:0268
/sys/class/input/js0/device/id/vendor:054c
/sys/class/input/js0/device/id/version:0100
alexander@shepard:~$
The kernel header files also specify 0x05 (and not 0x06) as the bustype for Bluetooth. [1]
After making this one-byte change, my PS3 controller finally works ins OpenMW! ;-) [2]
Please consider making this one-byte change, so that the PS3 controller also works OOTB via Bluetooth. If there was a good reason for adding it with bustype 0x06 at the time, you might also consider keeping the old GUID and just adding a new entry!
Best regards
Alexander Kurtz
[0] https://github.com/spurious/SDL-mirror/blob/master/src/joystick/linux/SDL_sysjoystick.c#L123
[1] https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/include/uapi/linux/input.h#n233
[2] https://github.com/OpenMW/openmw/blob/master/files/gamecontrollerdb.txt#L96
The controllermap.c utility could use some improvement or a spin-off, to help make GCDB better. I think controllermap.c is a contributed test program so I'd bet the SDL devs would be receptive to updates as they probably don't have time to focus on it very much. I've been on the dev mailing list for a while and haven't seen much mention of this stuff.
We could create a new tool (maybe using controllermap.c as a starting point) for use here with GCDB that implements specific things that we want... like the new hints idea, checking for duplicate mappings, etc. Currently, the tool people are directed to use is controllermap.c, so making a tool that is part of the GCDB effort will probably be useful for people who want to submit (and really, GCDB should be about allowing users who actually own the controllers to easily make submissions that make sense and "just work" with SDL games).
It's not crazy difficult, but it's also non-trivial to get the controllermap program working (download SDL source, find controlermap.c, figure out how to compile and run it) just so a person can submit a mapping for their whizzy cool controller. It's tough for a non-techie to compile controllermap on all platforms.
Regarding submissions to the GCDB in general (from the controllermap.c utility), I would vote to scrutinize any new submissions with the notions about multiple mappings using the same input, diagonal inputs on the POV/DPAD controls and such.
SDL 2.0.4 changes the Windows XInput joystick layout. Its default mapping string for XInput controllers has been changed to reflect that, but this database is still using the old layout for its XInput mapping string.
Here's the comparison:
SDL 2.0.4:
xinput,XInput Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,leftstick:b8,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,
This database:
xinput,X360 Controller,a:b10,b:b11,back:b5,dpdown:b1,dpleft:b2,dpright:b3,dpup:b0,guide:b14,leftshoulder:b8,leftstick:b6,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b9,rightstick:b7,righttrigger:a5,rightx:a2,righty:a3,start:b4,x:b12,y:b13,platform:Windows,
Since SDL always includes an XInput mapping in Windows (when built with XInput support enabled), it might make sense to just drop the old XInput mapping from this database.
Nintendo Switch Pro Controller, GUID 030000007e0500000920000000000000, Windows 10
I have been using the https://github.com/williamahartman/Jamepad library, which takes mappings from this database. Everything seems to be working fine, except A, B, X and Y. When I press A, it's recognized as B (and vice versa). When I press X, it's as I had pressed Y (and vice versa).
The current mapping for this controller is:
030000007e0500000920000000000000,Nintendo Switch Pro Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Windows
That means:
Here you can see an example of the correct mapping: https://answers.unity.com/questions/1419842/nintendo-switch-pro-controller-mapping.html
Button layout: https://s2.thcdn.com/productimg/600/600/11396097-7804615740625038.jpg
Hey guys!
I'm on OS X, trying to make PS4 Controller work with steam, tried putting your file into game folders of several games, modified steam config file (although it gets changed back when a game is launched) and it does not work. Any suggestions?
I would like to use gamecontrollerdb.txt
in an open source project that has been released under the GNU General Public License v3.0. The SDL_GameControllerDB license file says the project can be redistributed, but one restriction stuck out to me:
- This notice may not be removed or altered from any source distribution.
Does this mean if I use any part of of SDL_GameControllerDB, the LICENSE
file must also be included? If so, how would I distinguish SDL_GameControllerDB's license from the license of my own project?
The newer version of the Xbox One Controller (Covert Forces, new one on shelves) doesn't seem to be supported by this .txt file. Any plans to update it with support?
Hey,
while I realize this database is not supposed to overwrite stock SDL mappings, there is at least one which is plain wrong.
I'm talking about one of DS3 mappings, namely the one with GUID 050000004c0500006802000000800000
. In SDL (and thus in this database too) its triggers are defined as:
lefttrigger:b6,righttrigger:b7
however, mapping this specific controller in Steam Link app gives a better mapping, where triggers are axes:
lefttrigger:a2,righttrigger:a5
What should be done about this? Other DualShock 3 mappings have correctly mapped triggers, this one is an outlier and my pad just happens to use that mapping on Raspbian.
Hello
Please add those mapping for Thrustmaster Run'N' Drive on Linux
030000004f04000009d0000000010000,Thrustmaster Run'N' Drive Wireless PS3,a:b1,b:b2,x:b0,y:b3,start:b9,guide:b12,back:b8,leftstick:b10,rightstick:b11,leftshoulder:b4,rightshoulder:b5,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:b6,righttrigger:b7
030000004f04000008d0000000010000,Thrustmaster Run'N' Drive Wireless,a:b1,b:b2,x:b0,y:b3,start:b9,back:b8,leftstick:b10,rightstick:b11,leftshoulder:b4,rightshoulder:b5,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,leftx:a0,lefty:a1,rightx:a2,righty:a5,lefttrigger:b6,righttrigger:b7
The configuration for the Xbox one pad is wrong there are unnecessary assignation that create problems, here is a corrected version.
030000005e040000dd02000003020000,Microsoft X-Box One padv2,x:b2,a:b0,b:b1,y:b3,back:b6,guide:b8,start:b7,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,dpup:h0.1,leftshoulder:b4,lefttrigger:a2,rightshoulder:b5,righttrigger:a5,leftstick:b9,rightstick:b10,leftx:a0,lefty:a1,rightx:a3,righty:a4,platform:Linux,
In the windows section, there are two entries with the same guid but different mappings (swapped rightx and righty):
8f0e0300000000000000504944564944,Piranha xtreme,platform:Windows,x:b3,a:b2,b:b1,y:b0,back:b8,start:b9,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,dpup:h0.1,leftshoulder:b6,lefttrigger:b4,rightshoulder:b7,righttrigger:b5,leftstick:b10,rightstick:b11,leftx:a0,lefty:a1,rightx:a3,righty:a2,
8f0e0300000000000000504944564944,Trust GTX 28,a:b2,b:b1,y:b0,x:b3,start:b9,back:b8,leftstick:b10,rightstick:b11,leftshoulder:b4,rightshoulder:b5,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:b6,righttrigger:b7,platform:Windows,
030000004b120000014d000000000000,NYKO AIRFLO EX,platform:Windows,a:b0,b:b1,x:b2,y:b3,back:b8,guide:b10,start:b9,leftstick:b11,rightstick:b12,leftshoulder:b4,rightshoulder:b5,dpup:h0.1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,leftx:a0,lefty:a1,rightx:a3,righty:a2,lefttrigger:b6,righttrigger:b7,
This should be merged into official SDL2 repo. Is there any reason why this is not done?
My Splatoon 2-edition Nintendo Switch Pro Controller (on macOS) has a different GUID from the one that is included in the database
030000007e0500000920000000000000 # in the database
030000007e0500000920000001000000 # GUID reported by SDL2 Gamepad Tool
Could you please confirm the bindings for that controller?
I have a controller which is recognized with that name under Linux, and I was going to submit bindings for Windows when I noticed that they don't match with the ones in the list. The direction pad, start/back buttons and the stick buttons/axes are OK, the problem is with the right quartet and the shoulder buttons.
I used the controllermap utility to generate my bindings, and they are identical for Linux and Windows. I followed the position of the buttons as shown in the controllermap picture, as I don't have any idea what the XBox button pattern is like - my gamepad is a PS clone (with coloured numbers instead of the trademarked symbols).
I hope it's not a case of two different manufacturers using the same chipset with two different button positions. :(
(BTW, the GreenAsia binding string needs cleanup - it contains duplicate entries, partially due to a controllermap bug to which I'm going to submit a patch as soon as I get the Bugzilla registration email...)
The buttons in the DB all map to XBOX360 style names. In order to display a representation of the physical button on the device in the UI, a symbol name would be required for each mapped button. E.g.: "square", "green", etc.
I am not sure how this could be added to the current txt file in a way it could not intefere with the way it is parsed.
Is this something that has been considered before and would it make sense to add this to this lib?
Two GUIDs, namely these:
79000600000000000000504944564944,G-Shark GS-GP702,a:b2,b:b1,x:b3,y:b0,back:b8,start:b9,leftstick:b10,rightstick:b11,leftshoulder:b4,rightshoulder:b5,dpup:h0.1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,leftx:a0,lefty:a1,rightx:a2,righty:a4,lefttrigger:b6,righttrigger:b7,platform:Windows,
79000600000000000000504944564944,NGS Phantom,a:b2,b:b3,y:b1,x:b0,start:b9,back:b8,leftstick:b10,rightstick:b11,leftshoulder:b4,rightshoulder:b5,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,leftx:a0,lefty:a1,rightx:a2,righty:a4,lefttrigger:b6,righttrigger:b7,platform:Windows,
and
ff113133000000000000504944564944,SVEN X-PAD,platform:Windows,a:b2,b:b3,y:b1,x:b0,start:b5,back:b4,leftshoulder:b6,rightshoulder:b7,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,leftx:a0,lefty:a1,rightx:a2,righty:a4,lefttrigger:b8,righttrigger:b9,
ff113133000000000000504944564944,Gembird JPD-DualForce,platform:Windows,a:b2,b:b3,x:b0,y:b1,start:b9,back:b8,leftshoulder:b4,rightshoulder:b5,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,leftx:a0,lefty:a1,rightx:a2,righty:a4,lefttrigger:b6,righttrigger:b7,leftstick:b10,rightstick:b11,
seem to be duplicated - is this a problem or does SDL2 resolve such by comparing the device name too?
EDIT:
According to SDL2 docs:
If a new mapping is loaded for an already known controller GUID, the later version will overwrite the one currently loaded.
So seems like those duplicate mappings do nothing and one of them should be removed.
Are there any plans to get these mappings included in upstream SDL_gamecontrollerdb.h?
While I appreciate collecting this information in a perhaps more accessible location than the SDL hg repo, I feel that a lot more people would benefit if these defaults were shipped with SDL. Have you already contacted the SDL developers about this?
So I've noticed that there's no mapping for Android in this repository; SDL2's SDL_gamecontrollerdb.h header has an internal mapping for the NVIDIA Shield controller, but that's it.
In my case, it's a twin PSX/PS2 adapter with a duplicated GUID of 03000000100800000100000010010000 (for two possible controllers), as reported on Ubuntu 14.04. The GUID itself, as well as a compatible mapping, are already present in this repository (although SDL2's testjoystick reports the joystick name of "Twin USB Joystick" for each controller, rather than "Twin USB PS2 Adapter").
Using a (quite) recent revision of SDL2, I have a working mapping for Android, and I can post it.
However, I've noticed that the GUID is currently just a part of the joystick's name on Android. Instead, the function InputDevice.getDescriptor() can be used, but this requires API level 16 or later.
These are the descriptors which I got for the two controllers on an android-x86-5.1-rc1.iso VM (they don't share the same descriptor): c6cb90158061a88b1ec3d7ad69bb16a621eb897e, ab5fdd8d1a14fc069dc3d249ecd9f0dbc188bb87.
I got the same descriptors via an experimental naugatx8620160902.iso VM. Unfortunately I can't seem to use the controllers (including the USB/PS adapter) with a couple of actual Android-powered devices.
Given that API level 16 is required, I guess getDescriptor() won't be used soon, but it may still be better that I don't post the mapping itself for updating the db right now.
There are entries in the DB with DPAD/HAT mappings that are not valid (h0.0, h0.9, etc.). I think this may be due to glitchy behavior of the SDL gamecontroller mapping tool (which can be tricky to use to get a valid mapping for every function do to the way way it works) and some misunderstanding of what to expect in the output by people running it and submitting config strings. Any DPAD/HAT mapping that is not one of the following is suspect:
I would list h1.1, h1.2, etc., but we don't have any devices that have more than one DPAD/HAT in the DB currently. When I have some time, I mean to look at the mapping tool that is included with SDL v2.0.7 to see if it can be improved a bit, but in the meantime, I think the mappings in gamecontrollerdb.txt should have invalid values filtered out, or even corrected if possible. I have a bunch of controllers, but none of the ones with invalid mappings.
The PS3 controller, according to wikipedia, has analog triggers.
(Dualshock 3 controller.)
http://en.wikipedia.org/wiki/DualShock
Yet, in the DB, the ps3 controller triggers are mapped to buttons?
Currently, I am getting digital values from the ps3 gamepad under SDL2, even with the SDL_GameControllerDB .txt file loaded.
Tested under OSX.
hello there, sorry to disturb anyone, but i m really running out of idea.
i just bought a new old stock, a roydsstick.ex for ps3 to use in pc.
i can test it on the device and printers just fine.
but when i open steambig picture or gamepadtool[by General Arcade] it wont detect it .
i have no experience in programming or this sort of thing,been tinkering with it since 3-4 hour ago. i really hope some one can help me here.
most of the program or games i wanted to try wont detect it.
here is the device id for the joystick
HID\VID_1F4F&PID_0003&REV_0001
please help.....
Since the project is inactive, I've been through all pull requests and have merged pretty much everything. I've also added some new automated checks (check for platform, check for duplicates).
https://github.com/p-groarke/SDL_GameControllerDB
Please send pull requests with new controller entries!
The 2.0.4 GUID version is released here https://github.com/p-groarke/SDL_GameControllerDB/releases/tag/2.0.4
I have one. It's correct and works great with xboxdrv. Problem is... the complexity. Need to successfully pair via blue-tooth to Linux box. Need udev rule to support SDL and create /dev/input/ipega9069 sym-link for xboxdrv.
Because of this, I'll just leave the diff and you can close this as you see fit.
[edit] Created pull #217 with reference to this so that users might be able to setup and use the gamepad.
diff --git a/gamecontrollerdb.txt b/gamecontrollerdb.txt
index 1a39ae8..08cdea7 100644
--- a/gamecontrollerdb.txt
+++ b/gamecontrollerdb.txt
@@ -282,6 +282,7 @@ xinput,XInput Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,
050000006964726f69643a636f6e0000,idroid:con,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux,
03000000b50700001503000010010000,impact,a:b2,b:b3,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b11,righttrigger:b7,rightx:a3,righty:a2,start:b9,x:b0,y:b1,platform:Linux,
03000000fd0500000030000000010000,InterAct GoPad I-73000 (Fighting Game Layout),a:b3,b:b4,back:b6,leftx:a0,lefty:a1,rightshoulder:b2,righttrigger:b5,start:b7,x:b0,y:b1,platform:Linux,
+0500000049190000020400001b010000,Ipega PG-9069 - Bluetooth Gamepad,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b161,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux,
030000006e0500000320000010010000,JC-U3613M - DirectInput Mode,a:b2,b:b3,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b8,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:b7,rightx:a2,righty:a3,start:b11,x:b0,y:b1,platform:Linux,
03000000300f00001001000010010000,Jess Tech Dual Analog Rumble Pad,a:b2,b:b3,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b11,righttrigger:b7,rightx:a3,righty:a2,start:b9,x:b0,y:b1,platform:Linux,
03000000ba2200002010000001010000,Jess Technology USB Game Controller,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,rightx:a3,righty:a2,start:b9,x:b3,y:b0,platform:Linux,
diff a/PG9069.cfg b/PG9069.cfg
--- a/PG9069.cfg 1969-12-31 17:00:00.000000000 -0700
+++ b/PG9069.cfg 2018-08-08 10:50:07.608467663 -0600
@@ -0,0 +1,54 @@
+[axismap]
+-Y1=Y1
+-Y2=Y2
+
+[buttonmap]
+
+[device-name]
+
+[device-usbid]
+
+[evdev-absmap]
+ABS_#0=X1
+ABS_#1=Y1
+ABS_#2=X2
+ABS_#5=Y2
+ABS_#16=DPAD_X
+ABS_#17=DPAD_Y
+ABS_#10=LT
+ABS_#9=RT
+
+[evdev-keymap]
+KEY_#304=A
+KEY_#305=B
+KEY_#307=X
+KEY_#308=Y
+KEY_#314=BACK
+KEY_#315=START
+KEY_#172=GUIDE
+KEY_#310=LB
+KEY_#312=LT
+KEY_#317=TL
+KEY_#311=RB
+KEY_#313=RT
+KEY_#318=TR
+
+[modifier]
+
+[relative-axis]
+
+[ui-axismap]
+
+[ui-buttonmap]
+
+[xboxdrv]
+evdev=/dev/input/ipega9069
+deadzone=6000
+evdev-debug=false
+mimic-xpad=true
+mimic-xpad-wireless=false
+dpad-as-button=false
+trigger-as-button=false
+silent=true
+
+[xboxdrv-daemon]
diff --git a/43-xboxdrv-uinput-plugdev.rules b/43-xboxdrv-uinput-plugdev.rules
index e69de29..fa74c6d 100644
--- a/43-xboxdrv-uinput-plugdev.rules
+++ b/43-xboxdrv-uinput-plugdev.rules
@@ -0,0 +1,6 @@
+# This rule was added for xboxdrv.
+# Allows non-root users to access uinput
+KERNEL=="uinput", SUBSYSTEM=="misc", OPTIONS+="static_node=uinput", TAG+="uaccess"
+
+# Added to support bluetooth symlink for iPega PG-9069 for xboxdrv
+SUBSYSTEM=="input", SUBSYSTEMS=="input", ATTRS{name}=="PG-9069", TAG+="uaccess", SYMLINK+="input/ipega9069", ENV{ID_INPUT_JOYSTICK}="1"
I want to send a pull request for these controllers (https://smile.amazon.com/dp/B01MZAYQSV/), but there's one thing I don't understand: for the "name" field in the configuration line, should I write my own useful name (like "iNNEXT SNES Retro USB"), or use the name that came from controllermap (which is just "USB Gamepad ")?
If you let me know what's preferred, I can send a PR that updates the README as well.
It would be useful for developers to be able to point people to a simple web page that lists the controllers that their SDL game supports. Maybe this repo could add a web page (with GitHub Pages) that lists the supported controllers given a commit hash (and optionally SDL version) by parsing the database from the given commit.
Turns out that many generic Chinese controllers based on the same PC TWIN SHOCK board from DragonRise Inc. share the same USB vendor (0x0079
) and product (0x0006
) identifiers, but they also use slightly different button layouts, causing conflicts because the SDL2 gamepad GUID cannot distinguish between them.
My NGS Phantom mainly conflicts with #86 in Linux, and the "G-Shark GS-GP702" in Windows. Funnily enough in macOS looks like the GUID is slightly different, for some reason.
These are the correct mappings for Linux, macOS and Windows:
03000000790000000600000010010000,NGS Phantom---LNX,a:b2,b:b3,x:b0,y:b1,back:b8,start:b9,leftstick:b10,rightstick:b11,leftshoulder:b4,rightshoulder:b5,dpup:h0.1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,leftx:a0,lefty:a1,rightx:a3,righty:a4,lefttrigger:b6,righttrigger:b7,platform:Linux,
03000000790000000600000007010000,NGS Phantom---MAC,a:b2,b:b3,x:b0,y:b1,back:b8,start:b9,leftstick:b10,rightstick:b11,leftshoulder:b4,rightshoulder:b5,dpup:h0.1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,leftx:a0,lefty:a1,rightx:a3,righty:a4,lefttrigger:b6,righttrigger:b7,platform:Mac OS X,
03000000790000000600000000000000,NGS Phantom---WIN,a:b2,b:b3,x:b0,y:b1,back:b8,start:b9,leftstick:b10,rightstick:b11,leftshoulder:b4,rightshoulder:b5,dpup:h0.1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,leftx:a0,lefty:a1,rightx:a2,righty:a4,lefttrigger:b6,righttrigger:b7,platform:Windows,
I ship a game with these community mappings and I'm having trouble playing with my own controller because everything is subtly broken.
PS: Maybe Ryan C. Gordon can add some additional optional bits to tell them apart. Maybe by optionally matching by VID/PID/Version/Revision/Firmware instead of only VID/PID.
In SDL 2.0.5 the USB device GUIDs are standardized across platforms to the Linux format.
For example, the Windows GUID gets a 03 prefix (USB) and the VID and PID are split and the final string is removed:
341a3608000000000000504944564944
becomes
03000000341a00003608000000000000
On Mac OS X the device version has been added to the GUID and it has been split similarly:
4c05000000000000c405000000000000
becomes
030000004c050000c405000000010000
I am working on a new (separate) db file to map buttons to appropriate names. This will allow you to display appropriate graphics for controllers. The goal isn't to be perfect, but to at least show the right name for buttons that affect gameplay.
Here is a draft of the format. I am looking for feedback on the available button names (am I missing a controller?), missing hints, or any unforeseen issues that would arise from this format.
# Game Controller Button Name DB
# Source: https://github.com/gabomdq/SDL_GameControllerDB
#
# Help
# Format : guid,name,a,b,hint,leftshoulder,lefttrigger,rightshoulder,righttrigger,x,y,platform
#
# Button strings (a,b,x,y) are :
# A, B, C, T, U, X, Y, Z, CROSS, CIRCLE, SQUARE, TRIANGLE, 1, 2, 3, 4, 5, 6
#
# Shoulder strings (leftshoulder,rightshoulder) are :
# LB, L1, RB, R1, L, R, 5, 6, 7, 8
#
# Trigger strings (lefttrigger,righttrigger) are :
# LT, L2, RT, R2, ZL, ZR, Z, 5, 6, 7, 8, 9, 10
#
# Hints are :
# XBOX, PS, NINTENDO, SEGA, ARCADE
#
# Example
# 03000000022000000090000000000000,8Bitdo NES30 Pro,a:B,b:A,hint:NINTENDO,leftshoulder:L1,lefttrigger:L2,rightshoulder:R1,righttrigger:R2,x:Y,y:X,platform:Windows,
Again, the goal is not to be perfect, but to at least show the right names for in-game buttons (start,home,select aren't included). The format should mimic the existing db as closely as possible.
Recently for a patch in a project about joystick is noticed that the mapping for DragonRise Inc. Generic USB Joystick
was wrong on some axis. The left Y was inverted with the right X.
I regenerated the mapping an now i have:
03000000790000000600000010010000,DragonRise Inc. Generic USB Joystick ,x:b3,a:b2,b:b1,y:b0,back:b8,start:b9,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,dpup:h0.1,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,leftstick:b10,rightstick:b11,leftx:a0,lefty:a3,rightx:a1,righty:a4
We can notice that it was before: lefty:a1,rightx:a3
.
Could someone test if i'm right or it's something with kernel module or system ? Thanks in advance.
As said in the title, here is the mapping I have for my Mad Catz Fightpad "Street Fighter x Tekken". I thought I had already reported it but I don't see it in the list.
03000000ad1b00002ef0000090040000,Mad Catz Fightpad SFxT,platform:Linux,a:b0,b:b1,y:b3,x:b2,start:b7,guide:b8,back:b6,leftshoulder:b4,rightshoulder:b5,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,lefttrigger:a2,righttrigger:a5
I assume it should be the same for all Mad Catz Fightpads and not the "Street Fighter x Tekken" editions specifically but just in case...
Is there a way to invert joystick axis in controllerdb.txt?
I am tryng to map Microsoft Sidewinder Wheel and need to invert both pedal axis (accerelator and brakes)
Buttons work, steering is OK, accerlerator and brakes are mapped to right and left triggers.
Tomi
too lazy to make a PR~
050000007e0500003003000001000000,Nintendo Wii U Pro Controller,platform:Linux,leftx:a0,lefty:a1,rightx:a2,righty:a3,b:b0,a:b1,x:b2,y:b3,leftshoulder:b4,rightshoulder:b5,lefttrigger:b6,righttrigger:b7,back:b8,start:b9,guide:b10,leftstick:b11,rightstick:b12,dpup:b13,dpdown:b14,dpleft:b15,dpright:b16,
Adding following line makes it work:
030000006d04000016c2000000020000,Logitech Dual Action,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Mac OS X,
the great majority of dpad-only devices reflect input on the first two axes instead of POV or buttons. while the new sdl map format does accomodate axis directions on buttons via modifiers (ie: ‘dpadleft:-a0’) and this would presumably be how people would tend to follow the mapping configurator prompts, data in the db is inconsistent.
i’d argue that it’s actually more useful to follow the lead of the device concensus and map such dpads to ‘leftx’ and ‘lefty’ (again, only in cases where there are no analogue sticks and the device reflects dpad input via axes), both because of better backward compatibility for the maps, and because it is generally most useful in most applications to have directional axes input as opposed to xinput-dpad/pov-hat type input.
most of the applicable maps (presumably created on an older version of the spec) in the db are already laid out this way, but a few do use direction modifiers to map axes to the ‘dpad[..]’ keys.
regardless of which way is deemed “correct”, perhaps the linting process could identify these cases and unify the format
4c05000000000000c405000000000000,PS4 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b13,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,Platform:Mac OS X,
However my local config gamecontrollerdb.local.txt
does not override gamecontrollerdb.txt
Any ideas?
anybody knows a proper txt for that controller ?
the 1P stick mixes up left/right and up/down as the same inputs, ignoring the directions, resulting in only left/bottom working
03000000c0160000e105000001010000,Xin-Mo Xin-Mo Dual Arcade,platform:Linux,b:b4,a:b3,x:b0,leftshoulder:b2,dpup:a1,dpdown:a1,start:b7,dpright:a0,rightshoulder:b5,guide:b9,y:b1,back:b6,dpleft:a0,
I'm trying to load the current file and do look-ups on it for testing. I'm running on WIndows 10. Code looks like this:
int nmaps = SDL_GameControllerAddMappingsFromFile("gamecontrollerdb.txt");
SDL_JoystickGUID guid = SDL_JoystickGetGUIDFromString("341a3608000000000000504944564944");
char gu[51];
SDL_JoystickGetGUIDString(guid, gu, 50);
char *tst = SDL_GameControllerMappingForGUID(guid);
if (tst)
printf(" %s", tst);
else
printf(" lookup FAILED: %s", SDL_GetError());
nmaps is 31... however, there appear to be 46 mappings for Windows DINPUT devices in the file... so I'm not sure why they aren't all loaded.
tst is NULL ... there is no error reported by SDL_GetError().
guid: 030000004c050000c405000011010000
To fix, replace:
lefttrigger:b6,righttrigger:b7
with
lefttrigger:a3,righttrigger:a4
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.