Thread (50 messages) 50 messages, 4 authors, 2013-06-03

Re: [RFC 24/26] HID: wiimote: support Nintendo Wii U Pro Controller

From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Date: 2013-05-08 17:26:08

On Wed, May 08, 2013 at 01:20:58PM -0400, Todd Showalter wrote:
On Wed, May 8, 2013 at 1:05 PM, Dmitry Torokhov
[off-list ref] wrote:
quoted
Or you have your library that provides ABS->BTN translation.

You can even have your API structured such that consumer provides list
of events it is interested in and the library tries to synthesize
missing events if it can.
    That's in the plans.
quoted
So we already have:

#define BTN_A                   0x130
#define BTN_B                   0x131
#define BTN_C                   0x132
#define BTN_X                   0x133
#define BTN_Y                   0x134
#define BTN_Z                   0x135
#define BTN_TL                  0x136
#define BTN_TR                  0x137
#define BTN_TL2                 0x138
#define BTN_TR2                 0x139
#define BTN_SELECT              0x13a
#define BTN_START               0x13b
#define BTN_MODE                0x13c
#define BTN_THUMBL              0x13d
#define BTN_THUMBR              0x13e

So if we really want to have BTN_NORTH, etc, we want to alias existing
ones.
    The problem is that the alias differs with hardware.  BTN_A would be:

- BTN_SOUTH on xbox gamepads
- BTN_EAST on nintendo gamepads and ouya

    Nintendo is:

A -> WEST
B -> SOUTH
X -> NORTH
Y -> EAST

   While Microsoft is:

A -> SOUTH
B -> EAST
X -> WEST
Y -> NORTH

    They're mirror images of each other. So just aliasing is going to
break something.
We should take existing in-kernel mapping (that would be XBOX and other
less advanced gamepads in drivers/input/joystick), alias
NORTH/SOUTH/EAST/WEST accordingly, have new users use NSEW button
definitions.

Thanks.

-- 
Dmitry
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help