Joystick Identification [2]

I am sure that some time ago someone asked something similar, but I cant
find.

I want to create a simple database of joysticks and its features, buttons,
if it is haptic, etc.

The NAME parameter seems to be the primary key… but does not look
reliable.
For example, some generica gamepads only identify itself as “USB Gamepad”.
On Mac OS X, the Xbox 360 wired controller identify itself only as
"Controller".

Is it possible to get the vendor ID or a unique device ID or something?
It will be very important to differentiate each gamepad.

Thanks a lot
Rodrigo Rocha*
(please note I already posted this on the developmente forums before, but,
for some reason, it does nome come to the sdl list, so, i am re-sending it)*

That was me, and I threw my thoughts up at
nathancoulson.com/proj_conndb.php. I wanted a cross platform is for
joysticks, but other then the page, I have not done any further work on it.On Nov 13, 2012 1:32 PM, “Rodrigo” wrote:

I am sure that some time ago someone asked something similar, but I cant
find.

I want to create a simple database of joysticks and its features, buttons,
if it is haptic, etc.

The NAME parameter seems to be the primary key… but does not look
reliable.
For example, some generica gamepads only identify itself as “USB Gamepad”.
On Mac OS X, the Xbox 360 wired controller identify itself only as
"Controller".

Is it possible to get the vendor ID or a unique device ID or something?
It will be very important to differentiate each gamepad.

Thanks a lot
Rodrigo Rocha

(please note I already posted this on the developmente forums before, but,
for some reason, it does nome come to the sdl list, so, i am re-sending it)
*


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Funny you should ask, that’s something else we’re in the process of working
on. We haven’t done the Linux version of this though, so if someone knows
how to get that info, that would be awesome.On Tue, Nov 13, 2012 at 12:25 PM, Rodrigo wrote:

I am sure that some time ago someone asked something similar, but I cant
find.

I want to create a simple database of joysticks and its features, buttons,
if it is haptic, etc.

The NAME parameter seems to be the primary key… but does not look
reliable.
For example, some generica gamepads only identify itself as “USB Gamepad”.
On Mac OS X, the Xbox 360 wired controller identify itself only as
"Controller".

Is it possible to get the vendor ID or a unique device ID or something?
It will be very important to differentiate each gamepad.

Thanks a lot
Rodrigo Rocha

(please note I already posted this on the developmente forums before, but,
for some reason, it does nome come to the sdl list, so, i am re-sending it)
*


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

I hope that the final implementation of this doesn’t make the same
assumption as one of the suggestions in the thread time ago which was
that all controllers were similar to the 360 or PS3 ones. Indeed many
are clones of those (and especially the latter), but there are also
many controllers that don’t follow this. Controllers with 6 face
buttons instead of 4 come to mind.

I’d rather have hints as to what roles does each button have in
different contexts (which may vary even depending on the system region

  • OK and Cancel buttons being swapped, anyone?).

Some examples that come to mind for buttons:

  • MAIN
  • SECONDARY
  • SPECIAL1
  • SPECIAL2
  • OK
  • CANCEL
  • PAUSE

For axes:

  • MOVE_X
  • MOVE_Y
  • AIM_X
  • AIM_Y

For example, on a 360 controller, MAIN would be mapped to A, SECONDARY
to X, SPECIAL1 to B, SPECIAL2 to Y, OK to A, CANCEL to B, PAUSE to
Start, MOVE_X/Y to the left stick and AIM_X/Y to the right stick. Does
this make any sense?

If I had the time I’d make a full-blown library that would take care
of all user input (including input with keyboard, mouse, joysticks,
touch, etc.) and even allow assignments of complex controls (e.g.
mapping multiple inputs to the same action, or making use of chording
to allow some specific input, etc.). This is something that would take
lots of time though (which is why I haven’t bothered with it yet)
and is outside the scope of this discussion, though.

2012/11/13 Sam Lantinga :> Funny you should ask, that’s something else we’re in the process of working

on. We haven’t done the Linux version of this though, so if someone knows
how to get that info, that would be awesome.

On Tue, Nov 13, 2012 at 12:25 PM, Rodrigo wrote:

I am sure that some time ago someone asked something similar, but I cant
find.

I want to create a simple database of joysticks and its features, buttons,
if it is haptic, etc.

The NAME parameter seems to be the primary key… but does not look
reliable.
For example, some generica gamepads only identify itself as “USB Gamepad”.
On Mac OS X, the Xbox 360 wired controller identify itself only as
"Controller".

Is it possible to get the vendor ID or a unique device ID or something?
It will be very important to differentiate each gamepad.

Thanks a lot
Rodrigo Rocha

(please note I already posted this on the developmente forums before, but,
for some reason, it does nome come to the sdl list, so, i am re-sending it)


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

I’ll throw in my CAD$0.02 here.

Nintendo, for example, enforces that the icons of Wiimote button (1, 2,
Z, etc.) is displayed next to choices in dialog boxes. That eliminates
the ambiguity of what button does what in certain contexts.

Also, I suggest that a first layer maps buttons to integers (0…N) and
a second layer maps those integers to symbols/strings (0->“A”, 1->“B”,
2->“X”, 3->“Y”, etc.). That way a program can use controller profiles to

  1. map symbolic button events to game functions or b) let the user
    assign raw button events to game functions.

Best regards,
ChrisOn 12-11-13 09:01 PM, Sik the hedgehog wrote:

I’d rather have hints as to what roles does each button have in
different contexts (which may vary even depending on the system region

  • OK and Cancel buttons being swapped, anyone?).

The initial implementation will be a gamepad layer on top of the existing
SDL joystick API, and will support controllers that look like two-stick, 4
button +random other things gamepads. The goal is to give the game
developer a contract that if it uses this API, those types of controllers
will have standard events on all supported platforms.

What you’re describing is a lofty goal and definitely something useful, and
is something the Khronos working group would love help with:
http://www.khronos.org/streaminput/On Tue, Nov 13, 2012 at 6:01 PM, Sik the hedgehog < sik.the.hedgehog at gmail.com> wrote:

I hope that the final implementation of this doesn’t make the same
assumption as one of the suggestions in the thread time ago which was
that all controllers were similar to the 360 or PS3 ones. Indeed many
are clones of those (and especially the latter), but there are also
many controllers that don’t follow this. Controllers with 6 face
buttons instead of 4 come to mind.

I’d rather have hints as to what roles does each button have in
different contexts (which may vary even depending on the system region

  • OK and Cancel buttons being swapped, anyone?).

Some examples that come to mind for buttons:

  • MAIN
  • SECONDARY
  • SPECIAL1
  • SPECIAL2
  • OK
  • CANCEL
  • PAUSE

For axes:

  • MOVE_X
  • MOVE_Y
  • AIM_X
  • AIM_Y

For example, on a 360 controller, MAIN would be mapped to A, SECONDARY
to X, SPECIAL1 to B, SPECIAL2 to Y, OK to A, CANCEL to B, PAUSE to
Start, MOVE_X/Y to the left stick and AIM_X/Y to the right stick. Does
this make any sense?

If I had the time I’d make a full-blown library that would take care
of all user input (including input with keyboard, mouse, joysticks,
touch, etc.) and even allow assignments of complex controls (e.g.
mapping multiple inputs to the same action, or making use of chording
to allow some specific input, etc.). This is something that would take
lots of time though (which is why I haven’t bothered with it yet)
and is outside the scope of this discussion, though.

2012/11/13 Sam Lantinga <@slouken>:

Funny you should ask, that’s something else we’re in the process of
working
on. We haven’t done the Linux version of this though, so if someone
knows
how to get that info, that would be awesome.

On Tue, Nov 13, 2012 at 12:25 PM, Rodrigo wrote:

I am sure that some time ago someone asked something similar, but I cant
find.

I want to create a simple database of joysticks and its features,
buttons,

if it is haptic, etc.

The NAME parameter seems to be the primary key… but does not look
reliable.
For example, some generica gamepads only identify itself as “USB
Gamepad”.

On Mac OS X, the Xbox 360 wired controller identify itself only as
"Controller".

Is it possible to get the vendor ID or a unique device ID or something?
It will be very important to differentiate each gamepad.

Thanks a lot
Rodrigo Rocha

(please note I already posted this on the developmente forums before,
but,

for some reason, it does nome come to the sdl list, so, i am re-sending
it)


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Well, what I was thinking more was more along the lines of “oh you
want to know what button has this role, OK it’s button number
(something)” (i.e. basically a function to see what button/axis is
assigned to each role). Should work perfectly with what’s there
already and shouldn’t prevent games from using anything that wasn’t
assigned any role in particular.

I suppose its main use would be to help the program determine what
would be good default settings for the game controls.

2012/11/14 Sam Lantinga :> The initial implementation will be a gamepad layer on top of the existing

SDL joystick API, and will support controllers that look like two-stick, 4
button +random other things gamepads. The goal is to give the game
developer a contract that if it uses this API, those types of controllers
will have standard events on all supported platforms.

What you’re describing is a lofty goal and definitely something useful, and
is something the Khronos working group would love help with:
http://www.khronos.org/streaminput/

On Tue, Nov 13, 2012 at 6:01 PM, Sik the hedgehog <@Sik_the_hedgehog> wrote:

I hope that the final implementation of this doesn’t make the same
assumption as one of the suggestions in the thread time ago which was
that all controllers were similar to the 360 or PS3 ones. Indeed many
are clones of those (and especially the latter), but there are also
many controllers that don’t follow this. Controllers with 6 face
buttons instead of 4 come to mind.

I’d rather have hints as to what roles does each button have in
different contexts (which may vary even depending on the system region

  • OK and Cancel buttons being swapped, anyone?).

Some examples that come to mind for buttons:

  • MAIN
  • SECONDARY
  • SPECIAL1
  • SPECIAL2
  • OK
  • CANCEL
  • PAUSE

For axes:

  • MOVE_X
  • MOVE_Y
  • AIM_X
  • AIM_Y

For example, on a 360 controller, MAIN would be mapped to A, SECONDARY
to X, SPECIAL1 to B, SPECIAL2 to Y, OK to A, CANCEL to B, PAUSE to
Start, MOVE_X/Y to the left stick and AIM_X/Y to the right stick. Does
this make any sense?

If I had the time I’d make a full-blown library that would take care
of all user input (including input with keyboard, mouse, joysticks,
touch, etc.) and even allow assignments of complex controls (e.g.
mapping multiple inputs to the same action, or making use of chording
to allow some specific input, etc.). This is something that would take
lots of time though (which is why I haven’t bothered with it yet)
and is outside the scope of this discussion, though.

2012/11/13 Sam Lantinga :

Funny you should ask, that’s something else we’re in the process of
working
on. We haven’t done the Linux version of this though, so if someone
knows
how to get that info, that would be awesome.

On Tue, Nov 13, 2012 at 12:25 PM, Rodrigo wrote:

I am sure that some time ago someone asked something similar, but I
cant
find.

I want to create a simple database of joysticks and its features,
buttons,
if it is haptic, etc.

The NAME parameter seems to be the primary key… but does not look
reliable.
For example, some generica gamepads only identify itself as “USB
Gamepad”.
On Mac OS X, the Xbox 360 wired controller identify itself only as
"Controller".

Is it possible to get the vendor ID or a unique device ID or something?
It will be very important to differentiate each gamepad.

Thanks a lot
Rodrigo Rocha

(please note I already posted this on the developmente forums before,
but,
for some reason, it does nome come to the sdl list, so, i am re-sending
it)


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

The OK/Cancel button thing is not as simple as it seems.

The problem strikes in that the roles for OK and Cancel buttons in
menus for the rhombus 4-button layout is different for Asia and
outside it. In Asia, the right button is OK and the bottom button is
Cancel. Outside Asia it’s the other way. This becomes troublesome
though because in-game actions are still mapped the same way in both
cases (bottom button is the main action, left button is the secondary
action, etc.), so swapping the button IDs will just make things worse
instead of fixing the problem.

It’s due to stuff like this that we need the concept of roles, because
it’s possible that a single button is performing multiple roles at the
same time.

2012/11/14 Chris Eineke :> On 12-11-13 09:01 PM, Sik the hedgehog wrote:

I’d rather have hints as to what roles does each button have in
different contexts (which may vary even depending on the system region

  • OK and Cancel buttons being swapped, anyone?).

I’ll throw in my CAD$0.02 here.

Nintendo, for example, enforces that the icons of Wiimote button (1, 2, Z,
etc.) is displayed next to choices in dialog boxes. That eliminates the
ambiguity of what button does what in certain contexts.

Also, I suggest that a first layer maps buttons to integers (0…N) and a
second layer maps those integers to symbols/strings (0->“A”, 1->“B”, 2->“X”,
3->“Y”, etc.). That way a program can use controller profiles to 1) map
symbolic button events to game functions or b) let the user assign raw
button events to game functions.

Best regards,
Chris


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Yup, I agree, though it’s outside the scope of what is being implemented
right now.

Once we get unique joystick identifiers in, you’ll be able to implement
something like this easily on top of SDL.

Cheers!On Tue, Nov 13, 2012 at 8:59 PM, Sik the hedgehog < sik.the.hedgehog at gmail.com> wrote:

The OK/Cancel button thing is not as simple as it seems.

The problem strikes in that the roles for OK and Cancel buttons in
menus for the rhombus 4-button layout is different for Asia and
outside it. In Asia, the right button is OK and the bottom button is
Cancel. Outside Asia it’s the other way. This becomes troublesome
though because in-game actions are still mapped the same way in both
cases (bottom button is the main action, left button is the secondary
action, etc.), so swapping the button IDs will just make things worse
instead of fixing the problem.

It’s due to stuff like this that we need the concept of roles, because
it’s possible that a single button is performing multiple roles at the
same time.

2012/11/14 Chris Eineke :

On 12-11-13 09:01 PM, Sik the hedgehog wrote:

I’d rather have hints as to what roles does each button have in
different contexts (which may vary even depending on the system region

  • OK and Cancel buttons being swapped, anyone?).

I’ll throw in my CAD$0.02 here.

Nintendo, for example, enforces that the icons of Wiimote button (1, 2,
Z,
etc.) is displayed next to choices in dialog boxes. That eliminates the
ambiguity of what button does what in certain contexts.

Also, I suggest that a first layer maps buttons to integers (0…N) and a
second layer maps those integers to symbols/strings (0->“A”, 1->“B”,
2->“X”,
3->“Y”, etc.). That way a program can use controller profiles to 1) map
symbolic button events to game functions or b) let the user assign raw
button events to game functions.

Best regards,
Chris


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Cc:
Funny you should ask, that’s something else we’re in the process of
working on. We haven’t done the Linux version of this though, so if
someone knows how to get that info, that would be awesome.

You are always working on what people are asking… funny :smiley:

That was me, and I threw my thoughts up at

nathancoulson.com/proj_conndb.php. I wanted a cross platform is for
joysticks, but other then the page, I have not done any further work on it.

Yeah, now I remember :slight_smile:

Cc:
I hope that the final implementation of this doesn’t make the same
assumption as one of the suggestions in the thread time ago which was
that all controllers were similar to the 360 or PS3 ones. Indeed many
are clones of those (and especially the latter), but there are also
many controllers that don’t follow this. Controllers with 6 face
buttons instead of 4 come to mind.

I’d rather have hints as to what roles does each button have in
different contexts (which may vary even depending on the system region

  • OK and Cancel buttons being swapped, anyone?).

Some examples that come to mind for buttons:

  • MAIN
  • SECONDARY
  • SPECIAL1
  • SPECIAL2
  • OK
  • CANCEL
  • PAUSE

For axes:

  • MOVE_X
  • MOVE_Y
  • AIM_X
  • AIM_Y

For example, on a 360 controller, MAIN would be mapped to A, SECONDARY
to X, SPECIAL1 to B, SPECIAL2 to Y, OK to A, CANCEL to B, PAUSE to
Start, MOVE_X/Y to the left stick and AIM_X/Y to the right stick. Does
this make any sense?

If I had the time I’d make a full-blown library that would take care
of all user input (including input with keyboard, mouse, joysticks,
touch, etc.) and even allow assignments of complex controls (e.g.
mapping multiple inputs to the same action, or making use of chording
to allow some specific input, etc.). This is something that would take
lots of time though (which is why I haven’t bothered with it yet)
and is outside the scope of this discussion, though.

This is what I have in mind at first.
But for now I want to make something simpler, with only the key
names/labels, number off buttons, etc.
Of course would be possible to expand with this info in the future. But I
think I need to start simple.> From: Sam Lantinga

To: SDL Development List
Date: Tue, 13 Nov 2012 17:23:38 -0800
Subject: Re: [SDL] Joystick Identification [2]
From: sik.the.hedgehog@gmail.com (Sik the hedgehog)
To: SDL Development List
Date: Tue, 13 Nov 2012 23:01:08 -0300
Subject: Re: [SDL] Joystick Identification [2]

Date: Wed, 14 Nov 2012 01:59:46 -0300

From: Sik the hedgehog <sik.the.hedgehog at gmail.com>
To: SDL Development List
Subject: Re: [SDL] Joystick Identification [2]
Message-ID:
<CAEyBR+WwvaRRQ3aHesQ_
BSvmkW30xCZ-ND=8chBhW5ZksAVnww at mail.gmail.com>
Content-Type: text/plain; charset=UTF-8

The OK/Cancel button thing is not as simple as it seems.

The problem strikes in that the roles for OK and Cancel buttons in
menus for the rhombus 4-button layout is different for Asia and
outside it. In Asia, the right button is OK and the bottom button is
Cancel. Outside Asia it’s the other way. This becomes troublesome
though because in-game actions are still mapped the same way in both
cases (bottom button is the main action, left button is the secondary
action, etc.), so swapping the button IDs will just make things worse
instead of fixing the problem.

It’s due to stuff like this that we need the concept of roles, because
it’s possible that a single button is performing multiple roles at the
same time.

I would just ignore this mess that sony caused and pick one.

Nintendo and Microsoft made entirely clear on which button confirms and
which button cancels.
For both, it is always the button A for A-dvance and B for B-ack, no matter
the position.
Microsoft even colored their controllers to make that more intuitive, don’t
know why nintendo didnt do that with wii like they did on GameCube.

The ocidental mappings for Sony controllers doesnt make sense, Circle
resembles “Right, OK, Go!, Advance”, and X “Cancel, go back, etc”.
Why the hell they swapped that in this side of the world?

[]s
Rodrigo Rocha

Actually Nintendo started it with the SNES. Originally Nintendo of
Japan made the menu roles map what they used to be in the NES - A to
accept, B to cancel. Then the Western side decided it was a better
idea to map menu roles based on their button position, resulting in B
to accept and Y to cancel. Sony just followed along the standard
Nintendo had set.

If the controls were turned 90? clockwise so that B was at the left
and A at the bottom none of this would have ever happened.

2012/11/14 Rodrigo :> I would just ignore this mess that sony caused and pick one.

Nintendo and Microsoft made entirely clear on which button confirms and
which button cancels.
For both, it is always the button A for A-dvance and B for B-ack, no matter
the position.
Microsoft even colored their controllers to make that more intuitive, don’t
know why nintendo didnt do that with wii like they did on GameCube.

The ocidental mappings for Sony controllers doesnt make sense, Circle
resembles “Right, OK, Go!, Advance”, and X “Cancel, go back, etc”.
Why the hell they swapped that in this side of the world?

Guys,
As far as finding the vendor device ID’s on linux, use lsusb. Maybe you
already know this but I figured it was worth mentioning since it hasn’t
been brought up in this thread yet and I didn’t see it in the info Nathan
had.

As far as a linux database, the kernel source has plenty of good info also.

  • Swyped from my droid.

Actually Nintendo started it with the SNES. Originally Nintendo of
Japan made the menu roles map what they used to be in the NES - A to
accept, B to cancel. Then the Western side decided it was a better
idea to map menu roles based on their button position, resulting in B
to accept and Y to cancel. Sony just followed along the standard
Nintendo had set.

If the controls were turned 90? clockwise so that B was at the left
and A at the bottom none of this would have ever happened.

2012/11/14 Rodrigo :On Nov 14, 2012 5:30 PM, “Sik the hedgehog” <sik.the.hedgehog at gmail.com> wrote:

I would just ignore this mess that sony caused and pick one.

Nintendo and Microsoft made entir…


SDL mailing list
SDL at lists.libsdl.org
http://lists.l

Thanks!On Wed, Nov 14, 2012 at 6:51 PM, Jonathan Greig wrote:

Guys,
As far as finding the vendor device ID’s on linux, use lsusb. Maybe you
already know this but I figured it was worth mentioning since it hasn’t
been brought up in this thread yet and I didn’t see it in the info Nathan
had.

As far as a linux database, the kernel source has plenty of good info also.

  • Swyped from my droid.

On Nov 14, 2012 5:30 PM, “Sik the hedgehog” <sik.the.hedgehog at gmail.com> wrote:

Actually Nintendo started it with the SNES. Originally Nintendo of
Japan made the menu roles map what they used to be in the NES - A to
accept, B to cancel. Then the Western side decided it was a better
idea to map menu roles based on their button position, resulting in B
to accept and Y to cancel. Sony just followed along the standard
Nintendo had set.

If the controls were turned 90? clockwise so that B was at the left
and A at the bottom none of this would have ever happened.

2012/11/14 Rodrigo :

I would just ignore this mess that sony caused and pick one.

Nintendo and Microsoft made entir…


SDL mailing list
SDL at lists.libsdl.org
http://lists.l


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Actually Nintendo started it with the SNES. Originally Nintendo of
Japan made the menu roles map what they used to be in the NES - A to
accept, B to cancel. Then the Western side decided it was a better
idea to map menu roles based on their button position, resulting in B
to accept and Y to cancel. Sony just followed along the standard
Nintendo had set.

If the controls were turned 90?? clockwise so that B was at the left
and A at the bottom none of this would have ever happened.

So… Nintendo started the mess, Sony followed and is stuck to this until
today. Makes sense…
Nintendo on the other hand fixed the mistake after the SNES.

We can still blame Sony :slight_smile: