Re: [AD] Ouya controller support

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


The Linux Joystick driver pretty much works as it is! It's just a few defines in linux/input.h that are missing. At first I got error EACCES when the driver opened the device but adding <uses-permission android:name="tv.ouya.DIRECT_INPUT_ACCESS"/> to the manifest solved it!

The adb shell has a tool getevent that can be used to examine the device in various ways:

shell@xxxxxxxxxx:/ $ getevent -lp /dev/input/event1                               
add device 1: /dev/input/event1
  name:     "OUYA Game Controller"
  events:
    KEY (0001): BTN_LEFT              BTN_RIGHT             BTN_MIDDLE            BTN_A                
                BTN_B                 BTN_C                 BTN_X                 BTN_Y                
                BTN_Z                 BTN_TL                BTN_TR                BTN_TL2              
                BTN_TR2               BTN_SELECT            BTN_START             BTN_MODE             
                BTN_THUMBL            BTN_THUMBR            013f                 
    REL (0002): REL_X                 REL_Y                 REL_WHEEL            
    ABS (0003): ABS_X                 : value 32768, min 0, max 65535, fuzz 255, flat 4095, resolution 0
                ABS_Y                 : value 32768, min 0, max 65535, fuzz 255, flat 4095, resolution 0
                ABS_Z                 : value 0, min 0, max 65535, fuzz 255, flat 4095, resolution 0
                ABS_RX                : value 33742, min 0, max 65535, fuzz 255, flat 4095, resolution 0
                ABS_RY                : value 32653, min 0, max 65535, fuzz 255, flat 4095, resolution 0
                ABS_RZ                : value 0, min 0, max 65535, fuzz 255, flat 4095, resolution 0
                ABS_MISC              : value 221, min 0, max 255, fuzz 0, flat 0, resolution 0
                0029                  : value 0, min 0, max 255, fuzz 0, flat 0, resolution 0
                002a                  : value 0, min 0, max 255, fuzz 0, flat 0, resolution 0
                002b                  : value 0, min 0, max 255, fuzz 0, flat 0, resolution 0
    MSC (0004): MSC_SCAN             
  input props:
    <none>

2013/7/12 Beoran <beoran@xxxxxxxxxx>
The /dev/input/event/* API should work, but perhaps it emits key and joystick events in a range that the new Linux joystick driver is currently ignoring. We're using some heuristics to determine if the input device is a joystick or not but they are not 100% certain. If you could run a tool like evtest, that would be perfect.


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/