Linux Gamepad Specification vs Android keylayout

EDIT: new info as 06/08/2025
Android keylayout files on OUYA are extremely flimsy, it malfunctions as you write wrong Linux key code or try to bind Linux key code to Android OS key events that expect for example axis input like triggers (left and right for shooting). I found if I tried different Linux key codes it mapped them partially to original OUYA controller somehow and even if I added one wrong Linux keycode that malfunctioned in OUYA console. Behaviour is suddenly all work or nothing works correctly. I post here correct detection on Linux HID descriptor, if Linux HID generic descriptor maps correctly all works in OUYA correctly. Don’t add multiple controller at same time because Linux HID descriptor does not map controller correctly. I got correctly working Shadowgun Ouya game with X Box 360 wired controller and it matches with Ouya controller 1:1 (Actually I have 8BitDo SN30 PRO+ controller on xinput mode as X Box 360 controller. Here is correct Linux HID generic descriptor mappings:

PS C:\ADB> adb shell su
root@android:/ # getevent -i
getevent -i
add device 1: /dev/input/event1
  bus:      0019
  vendor    0001
  product   0001
  version   0100
  name:     "gpio-keys"
  location: "gpio-keys/input0"
  id:       ""
  version:  1.0.1
  events:
    KEY (0001): 0074
  input props:
    <none>
add device 2: /dev/input/event0
  bus:      0003
  vendor    045e
  product   028e
  version   0114
  name:     "Microsoft X-Box 360 pad"
  location: "usb-tegra-ehci.2-1.1/input0"
  id:       ""
  version:  1.0.1
  events:
    KEY (0001): 0130  0131  0133  0134  0136  0137  013a  013b
                013c  013d  013e
    ABS (0003): 0000  : value 0, min -32768, max 32767, fuzz 16, flat 128, resolution 0
                0001  : value -1, min -32768, max 32767, fuzz 16, flat 128, resolution 0
                0002  : value 0, min 0, max 255, fuzz 0, flat 0, resolution 0
                0003  : value 0, min -32768, max 32767, fuzz 16, flat 128, resolution 0
                0004  : value -1, min -32768, max 32767, fuzz 16, flat 128, resolution 0
                0005  : value 0, min 0, max 255, fuzz 0, flat 0, resolution 0
                0010  : value 0, min -1, max 1, fuzz 0, flat 0, resolution 0
                0011  : value 0, min -1, max 1, fuzz 0, flat 0, resolution 0
  input props:
    <none>
could not get driver version for /dev/input/js0, Invalid argument
root@android:/ #
root@android:/ # getevent -lp /dev/input/event0
getevent -lp /dev/input/event0
add device 1: /dev/input/event0
  name:     "Microsoft X-Box 360 pad"
  events:
    KEY (0001): BTN_A                 BTN_B                 BTN_X                 BTN_Y            
                BTN_TL                BTN_TR                BTN_SELECT            BTN_START        
                BTN_MODE              BTN_THUMBL            BTN_THUMBR
    ABS (0003): ABS_X                 : value 0, min -32768, max 32767, fuzz 16, flat 128, resolution 0
                ABS_Y                 : value -1, min -32768, max 32767, fuzz 16, flat 128, resolution 0
                ABS_Z                 : value 0, min 0, max 255, fuzz 0, flat 0, resolution 0
                ABS_RX                : value 0, min -32768, max 32767, fuzz 16, flat 128, resolution 0
                ABS_RY                : value -1, min -32768, max 32767, fuzz 16, flat 128, resolution 0
                ABS_RZ                : value 0, min 0, max 255, fuzz 0, flat 0, resolution 0
                ABS_HAT0X             : value 0, min -1, max 1, fuzz 0, flat 0, resolution 0
                ABS_HAT0Y             : value 0, min -1, max 1, fuzz 0, flat 0, resolution 0
  input props:
    <none>
root@android:/ #

And really right joystick gets mapped on Linux HID generic descriptor as ABS_RX and ABS_RY (value min -32768, max 32767). Triggers get mapped ABS_Z and ABS_RZ (value 255).

Seems if Linux HID (Human Interface Devices) descriptor does HID mapping table on Linux kernel level before Adroid OS steps in (in our case OUYA console OS) we can only use in keylayout files Linux HID mapping table given keycodes to map to our
wanted Android keycodes used by Ouya original controllers.
For example to map getevent reported key 0x13c which gets Linux HID mapping table name BTN_MODE which equals in Linux keycode as 0x13d (number is in HEX hexadecimal)
How to Convert 13D from hexadecimal to decimal
So you don’t want to use in your Android keylayout file 0x13c directly because on Linux kernel level HID descriptor maps it to BTN_MODE as Linux keycode 0x13d and because kernel level Linux HID descriptor is more important than Android keylayout file mappings (because Android OS starts later than Linux kernel and feeds input to Android OS) you want to use already mapped Linux keycode 0x13d in your Android controller keylayout file for example:
0x13d HOME
HOME is Andorid keycode for:
KEYCODE_HOME
Key code constant: Home key. As integer value 3

virkeycode-linux - Key code values for linux
Ubuntu Manpage: virkeycode-linux - Key code values for linux
Key name BTN_START

   • 316 (0x13c)

     Key name BTN_MODE

   • 317 (0x13d)

4. Linux Gamepad Specification — The Linux Kernel documentation

Android gamepad Z and RZ (right joystick) axis values are in conflict with Linux kernel HID generic descriptor where Z and RZ are mapped as left trigger and right trigger. This is fundamental error between old and new Linux HID generic descriptor. All original and old Ouya games use Z and RZ axis as right joystick (Android OS gamepad specification) and underlaying Linux kernel HID generic descriptor maps by Linux OS specification Z and RZ as left and right triggers. That is why most 3rd party controllers on Ouya function somewhat in Ouya menu and get wacky in-games.

The getevent tool is a utility in Android that provides detailed information about input devices and captures a live stream of kernel input events. It is particularly useful for debugging and testing input-related functionalities on Android devices.
How to use:
getevent tool | Android Open Source Project
Use the -i option to get more information, including HID mapping tables and debugging information.
Use the -lp option to display textual labels for all event codes.

shell@android:/ $ getevent -lp /dev/input/event1
add device 1: /dev/input/event1
  name:     "Sony Interactive Entertainment Controller"
  events:
    KEY (0001): BTN_A                 BTN_B                 BTN_C                 BTN_X
                BTN_Y                 BTN_Z                 BTN_TL                BTN_TR
                BTN_TL2               BTN_TR2
    ABS (0003): ABS_X                 : value 1, min 0, max 2, fuzz 0, flat 0, resolution 0
                ABS_Y                 : value 1, min 0, max 2, fuzz 0, flat 0, resolution 0
    MSC (0004): MSC_SCAN
  input props:
    <none>
shell@android:/ $ getevent -lp /dev/input/event0
add device 1: /dev/input/event0
  name:     "Microsoft X-Box 360 pad"
  events:
    KEY (0001): BTN_A                 BTN_B                 BTN_X                 BTN_Y
                BTN_TL                BTN_TR                BTN_SELECT            BTN_START
                BTN_MODE              BTN_THUMBL            BTN_THUMBR
    ABS (0003): ABS_X                 : value 0, min -32768, max 32767, fuzz 16, flat 128, resolution 0
                ABS_Y                 : value 0, min -32768, max 32767, fuzz 16, flat 128, resolution 0
                ABS_Z                 : value 0, min 0, max 255, fuzz 0, flat 0, resolution 0
                ABS_RX                : value 0, min -32768, max 32767, fuzz 16, flat 128, resolution 0
                ABS_RY                : value 0, min -32768, max 32767, fuzz 16, flat 128, resolution 0
                ABS_RZ                : value 0, min 0, max 255, fuzz 0, flat 0, resolution 0
                ABS_HAT0X             : value 0, min -1, max 1, fuzz 0, flat 0, resolution 0
                ABS_HAT0Y             : value 0, min -1, max 1, fuzz 0, flat 0, resolution 0
  input props:
    <none>
shell@android:/ $

Android KeyEvents are used to handle physical or virtual keyboard input, button presses, or other key-related events in an Android application. They are part of the android.view.KeyEvent class. Here’s a concise overview:

Show live events like Linux HID descriptor maps physical generic controller

The following example shows a two-finger multi-touch gesture for a touchscreen using the Linux multi-touch input protocol “B”. The -l option displays textual labels and the -t option displays timestamps. Replace event1 with your correct device number.

adb shell su -- getevent -lt /dev/input/event1

KeyEvent Basics

  • Key Actions: Key events have actions like:
    • ACTION_DOWN: Key is pressed.
    • ACTION_UP: Key is released.
    • ACTION_MULTIPLE: Multiple key events occurred simultaneously.
  • Key Codes: Each key is represented by a unique constant (e.g., KEYCODE_HOME, KEYCODE_BACK, KEYCODE_VOLUME_UP).
    Android OS How to use:
    KeyEvent | API reference | Android Developers
    In Android, key layout files (.kl files) are used to map Linux key codes and axis codes to Android key codes and axis codes. These files also define associated policy flags for input devices. They are essential for customizing how physical input devices (like keyboards, game controllers, or other peripherals) interact with Android.

Key Features of Key Layout Files:

  1. Mapping: They translate hardware-specific key codes to Android’s standard key codes.
  2. Device-Specific: Each input device can have its own .kl file, especially for built-in devices like volume buttons, power buttons, or external controllers.
  3. Customization: Developers can modify or create .kl files to remap keys or change device behavior.

Common Use Cases:

  • External Keyboards: Remapping keys for custom layouts.
  • Game Controllers: Configuring buttons for gaming.
  • Special Devices: Adjusting input for car audio systems, Bluetooth devices, or other peripherals.

File Location:

  • System key layout files are typically stored in /system/usr/keylayout/.
  • Custom .kl files can be added to /data/system/devices/keylayout/ (requires root access).

Example of a Key Layout File:

Kopeeri kood

key 158   BACK
key 102   HOME
key 139   MENU
key 115   VOLUME_UP
key 114   VOLUME_DOWN

Notes:

  • Modifying .kl files often requires root access.
  • For non-rooted devices, apps can provide additional keyboard layouts starting from Android 4.1.

If you’re looking to remap keys or customize input behavior, .kl files are a powerful tool to explore!
Relation how Linux HID Descriptor maps original OUYA controller in Linux Kernel level and reports then these newly maped Linux keycodes to Android OS keyevents. I think OUYA hardware controller developers had to note how Linux kernel HID maps Ouya controller and then Ouya hardware controller engineers had to write OUYA Android OS keylayout. Note how Linux keycode integers go from 304 to 317? Look how wacky Linux key names sometime get (out of order). This out of order is caused by Linux kernel level HID Descriptor internal coding itself of it threats generic gamepads and gamepad feature sets (from one button to modern 2-analog sticks, 2 triggers and many buttons controllers/ gamepads):

# Copyright (C) 2011 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Vendor_2836_Product_0001.kl
# OUYA Game Controller
#Linux HID (human interface devices) Descriptor mapping tables

#Linux keycode Hexadecimal / Linux key name / Linux integer / Android keyevent
key 0x130 BTN_DEAD 304    BUTTON_A
key 0x133 BTN_C 307   BUTTON_B
key 0x131 BTN_A 305    BUTTON_X
key 0x132 BTN_B 306   BUTTON_Y

# Button "LB" maps to BUTTON_L1.
key 0x134 BTN_X 308    BUTTON_L1
# Button "RB" maps to BUTTON_R1.
key 0x135 BTN_Y 309    BUTTON_R1

# These two keycodes are for click (press from above) on analog control sticks.
key 0x136 BTN_Z 310    BUTTON_THUMBL
key 0x137 BTN_TL 311    BUTTON_THUMBR

# D-pad
key 0x138 BTN_TR 312    DPAD_UP
key 0x139 BTN_TL2 313    DPAD_DOWN
key 0x13a BTN_TR2 314   DPAD_LEFT
key 0x13b BTN_SELECT 315   DPAD_RIGHT

# Power and Home Key
key 0x13e BTN_THUMBL 318    HOME      #Short Press
key 0x13f N/ A N/ A (does not exist as Linux keycode)   HOME ALT  #Long Press

# Left (0x00, 0x01) and right (0x03, 0x04) analog control stick.
# The reported value for flat is 128 out of a range from -32767 to 32768, which is absurd.
# This confuses applications that rely on the flat value because the joystick actually
# settles in a flat range of +/- 4096 or so.
axis 0x00 X flat 4096
axis 0x01 Y flat 4096
axis 0x03 Z flat 4096
axis 0x04 RZ flat 4096

# Triggers.
# (Shoulder trigger buttons marked with "LT" and "RT" are analog.
# Each axis has range from 0 to 255.)
axis 0x02 LTRIGGER
axis 0x05 RTRIGGER
key 0x13c BTN_START 316   BUTTON_L2
key 0x13d BTN_MODE 317   BUTTON_R2

Xbox 360 controller wired:

# Copyright (C) 2011 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

#
# XBox 360 USB Controller
# Vendor_045e_Product_028e.kl
# NVIDIA Normalized Gamepad
#Linux HID (human interface devices) Descriptor mapping tables

#Linux keycode Hexadecimal / Linux key name / Linux integer / Android keyevent

key 0x130 BTN_DEAD 304    BUTTON_A
key 0x131 BTN_A 305   BUTTON_B
key 0x133 BTN_C 307    BUTTON_X
key 0x134 BTN_X 308   BUTTON_Y
# Button "LB" maps to BUTTON_L1.
key 0x136 BTN_Z 310    BUTTON_L1
# Button "RB" maps to BUTTON_R1.
key 0x137 BTN_TL 311    BUTTON_R1
key 0x13a BTN_TR2 314    BACK
key 0x13b BTN_SELECT 315   BUTTON_START
# Button with Xbox logo maps to HOME.
key 0x13c BTN_START 316   HOME
# These two keycodes are for click (press from above) on analog control sticks.
key 0x13d BTN_MODE 317   BUTTON_THUMBL
key 0x13e BTN_THUMBL 318   BUTTON_THUMBR

# Left (0x00, 0x01) and right (0x03, 0x04) analog control stick.
# The reported value for flat is 128 out of a range from -32767 to 32768, which is absurd.
# This confuses applications that rely on the flat value because the joystick actually
# settles in a flat range of +/- 4096 or so.
axis 0x00 X flat 4096
axis 0x01 Y flat 4096
axis 0x03 Z flat 4096
axis 0x04 RZ flat 4096

# Triggers.
# (Shoulder trigger buttons marked with "LT" and "RT" are analog.
# Each axis has range from 0 to 255.)
axis 0x02 LTRIGGER
axis 0x05 RTRIGGER

# Hat.
# (D-pad is reported as analog. Each axis has range from -1 to 1.)
axis 0x10 HAT_X
axis 0x11 HAT_Y

Playstation 3 controller:

# Copyright (C) 2011 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

#
# Sony Playstation(R)3 Controller
#
# NVIDIA Normalized Gamepad
# Vendor_054c_Product_0268.kl
#Linux HID (human interface devices) Descriptor mapping tables

#Linux keycode Hexadecimal / Linux key name / Linux integer / Android keyevent

key 0x124 BTN_TOP 292    DPAD_UP
key 0x125 BTN_TOP2 293   DPAD_RIGHT
key 0x126 BTN_PINKIE 294   DPAD_DOWN
key 0x127 BTN_BASE 295   DPAD_LEFT

# Button "Select" maps to BACK.
key 0x120 BTN_TASK 288   BACK
key 0x123 BTN_THUMB2 291   BUTTON_START
# Button with square image maps to BUTTON_X, due to placement analogy.
key 0x12f BTN_BASE6 303   BUTTON_X
# Button with triangle image maps to BUTTON_Y, due to placement analogy.
key 0x12c N/ A N/ A (does not have Linux keycode Match)   BUTTON_Y
# Button with cross image maps to BUTTON_A, due to placement analogy.
key 0x12e N/ A N/ A (does not have Linux keycode Match)   BUTTON_A
# Button with circle image maps to BUTTON_B, due to placement analogy.
key 0x12d N/ A N/ A (does not have Linux keycode Match)   BUTTON_B
key 0x12a BTN_BASE4 298   BUTTON_L1
key 0x12b BTN_BASE5 299   BUTTON_R1
key 0x128 BTN_BASE2 296   BUTTON_L2
key 0x129 BTN_BASE3 297   BUTTON_R2
# These two keycodes are for click (press from above) on analog sticks.
key 0x121 BTN_TRIGGER 289   BUTTON_THUMBL
key 0x122 BTN_THUMB 290   BUTTON_THUMBR

# Button with PlayStation logo maps to HOME
key 0x2d0 N/ A N/ A (does not have Linux keycode Match)   HOME

# Left Analog Stick
axis 0x00    X
axis 0x01    Y

# Right Analog Stick
axis 0x02    Z
axis 0x05    RZ

# D-pad axes
# axis 0x2c   -HAT_Y
# axis 0x2d   +HAT_X
# axis 0x2e   +HAT_Y
# axis 0x2f   -HAT_X

# L2 trigger
axis 0x30   LTRIGGER

# R2 trigger
axis 0x31   RTRIGGER

# L1 trigger
# axis 0x32

# R1 trigger
# axis 0x33

# Triangle
# axis 0x34

# Circle
# axis 0x35

# Cross
# axis 0x36

# Square
# axis 0x37

NVIDIA Normalized Gamepad
As of this writing, this specification takes into account over 25 different controllers from the major consoles to all major third party manufacturers. Moreover, with Google and NVIDIA recommending this specification to developers, as well as controller manufacturers, that number will only continue to grow.

Take special care to read all of the notes here, as they are important to fully implement the specification.
The Gamepad Specification

Credit to XDA forum for Ouya HID descriptor button mappings:

05 01 09 02 a1 01 85 06 09 01 a1 00 05 09 19 01 29 03 15 00 25 01 75 01 95 03 81 02 75 05 95 01 81 01 05 01 09 30 09 31 15 81 25 7f 75 08 95 02 81 06 09 38 15 81 25 7f 75 08 95 01 81 06 c0 c0 05 01 09 05 a1 01 85 07 a1 00 09 30 09 31 15 00 26 ff ff 35 00 46 ff ff 95 02 75 10 81 02 c0 a1 00 09 33 09 34 15 00 26 ff ff 35 00 46 ff ff 95 02 75 10 81 02 c0 a1 00 09 32 15 00 26 ff ff 35 00 46 ff ff 95 01 75 10 81 02 c0 a1 00 09 35 15 00 26 ff ff 35 00 46 ff ff 95 01 75 10 81 02 c0 05 09 19 01 29 10 95 10 75 01 81 02 06 00 ff a1 02 75 08 95 07 46 ff 00 26 ff 00 09 01 91 02 c0 c0 05 0c 09 01 a1 01 85 03 05 01 09 06 a1 02 05 06 09 20 15 00 26 ff 00 75 08 95 01 81 02 06 bc ff 0a ad bd 75 08 95 06 81 02 c0 c0 05 0c 09 01 a1 01 85 ff 05 06 95 01 75 02 19 24 29 26 81 02 75 06 81 01 c0 00 

  INPUT(6)[INPUT]
    Field(0)
      Physical(GenericDesktop.Pointer)
      Usage(3)
        Button.0001
        Button.0002
        Button.0003
      Logical Minimum(0)
      Logical Maximum(1)
      Report Size(1)
      Report Count(3)
      Report Offset(0)
      Flags( Variable Absolute )
    Field(1)
      Physical(GenericDesktop.Pointer)
      Usage(2)
        GenericDesktop.X
        GenericDesktop.Y
      Logical Minimum(-127)
      Logical Maximum(127)
      Report Size(8)
      Report Count(2)
      Report Offset(8)
      Flags( Variable Relative )
    Field(2)
      Physical(GenericDesktop.Pointer)
      Usage(1)
        GenericDesktop.Wheel
      Logical Minimum(-127)
      Logical Maximum(127)
      Report Size(8)
      Report Count(1)
      Report Offset(24)
      Flags( Variable Relative )
  INPUT(7)[INPUT]
    Field(0)
      Usage(2)
        GenericDesktop.X
        GenericDesktop.Y
      Logical Minimum(0)
      Logical Maximum(65535)
      Physical Minimum(0)
      Physical Maximum(65535)
      Report Size(16)
      Report Count(2)
      Report Offset(0)
      Flags( Variable Absolute )
    Field(1)
      Usage(2)
        GenericDesktop.Rx
        GenericDesktop.Ry
      Logical Minimum(0)
      Logical Maximum(65535)
      Physical Minimum(0)
      Physical Maximum(65535)
      Report Size(16)
      Report Count(2)
      Report Offset(32)
      Flags( Variable Absolute )
    Field(2)
      Usage(1)
        GenericDesktop.Z
      Logical Minimum(0)
      Logical Maximum(65535)
      Physical Minimum(0)
      Physical Maximum(65535)
      Report Size(16)
      Report Count(1)
      Report Offset(64)
      Flags( Variable Absolute )
    Field(3)
      Usage(1)
        GenericDesktop.Rz
      Logical Minimum(0)
      Logical Maximum(65535)
      Physical Minimum(0)
      Physical Maximum(65535)
      Report Size(16)
      Report Count(1)
      Report Offset(80)
      Flags( Variable Absolute )
    Field(4)
      Usage(16)
        Button.0001
        Button.0002
        Button.0003
        Button.0004
        Button.0005
        Button.0006
        Button.0007
        Button.0008
        Button.0009
        Button.000a
        Button.000b
        Button.000c
        Button.000d
        Button.000e
        Button.000f
        Button.0010
      Logical Minimum(0)
      Logical Maximum(65535)
      Physical Minimum(0)
      Physical Maximum(65535)
      Report Size(1)
      Report Count(16)
      Report Offset(96)
      Flags( Variable Absolute )
  INPUT(3)[INPUT]
    Field(0)
      Logical(GenericDesktop.Keyboard)
      Usage(1)
        0006.0020
      Logical Minimum(0)
      Logical Maximum(255)
      Physical Minimum(0)
      Physical Maximum(255)
      Report Size(8)
      Report Count(1)
      Report Offset(0)
      Flags( Variable Absolute )
    Field(1)
      Logical(GenericDesktop.Keyboard)
      Usage(6)
        ffbc.bdad
        ffbc.bdad
        ffbc.bdad
        ffbc.bdad
        ffbc.bdad
        ffbc.bdad
      Logical Minimum(0)
      Logical Maximum(255)
      Physical Minimum(0)
      Physical Maximum(255)
      Report Size(8)
      Report Count(6)
      Report Offset(8)
      Flags( Variable Absolute )
  INPUT(255)[INPUT]
    Field(0)
      Usage(3)
        0006.0024
        0006.0025
        0006.0026
      Logical Minimum(0)
      Logical Maximum(255)
      Physical Minimum(0)
      Physical Maximum(255)
      Report Size(2)
      Report Count(1)
      Report Offset(0)
      Flags( Variable Absolute )
  OUTPUT(7)[OUTPUT]
    Field(0)
      Usage(7)
        ff00.0001
        ff00.0001
        ff00.0001
        ff00.0001
        ff00.0001
        ff00.0001
        ff00.0001
      Logical Minimum(0)
      Logical Maximum(255)
      Physical Minimum(0)
      Physical Maximum(255)
      Report Size(8)
      Report Count(7)
      Report Offset(0)
      Flags( Variable Absolute )

Button.0001 ---> Key.LeftBtn
Button.0002 ---> Key.RightBtn
Button.0003 ---> Key.MiddleBtn
GenericDesktop.X ---> Relative.X
GenericDesktop.Y ---> Relative.Y
GenericDesktop.Wheel ---> Relative.Wheel
GenericDesktop.X ---> Absolute.X
GenericDesktop.Y ---> Absolute.Y
GenericDesktop.Rx ---> Absolute.Rx
GenericDesktop.Ry ---> Absolute.Ry
GenericDesktop.Z ---> Absolute.Z
GenericDesktop.Rz ---> Absolute.Rz
Button.0001 ---> Key.BtnA
Button.0002 ---> Key.BtnB
Button.0003 ---> Key.BtnC
Button.0004 ---> Key.BtnX
Button.0005 ---> Key.BtnY
Button.0006 ---> Key.BtnZ
Button.0007 ---> Key.BtnTL
Button.0008 ---> Key.BtnTR
Button.0009 ---> Key.BtnTL2
Button.000a ---> Key.BtnTR2
Button.000b ---> Key.BtnSelect
Button.000c ---> Key.BtnStart
Button.000d ---> Key.BtnMode
Button.000e ---> Key.BtnThumbL
Button.000f ---> Key.BtnThumbR
Button.0010 ---> Key.?
0006.0020 ---> Absolute.Misc
ffbc.bdad ---> Sync.Report
ffbc.bdad ---> Sync.Report
ffbc.bdad ---> Sync.Report
ffbc.bdad ---> Sync.Report
ffbc.bdad ---> Sync.Report
ffbc.bdad ---> Sync.Report
0006.0024 ---> Absolute.?
0006.0025 ---> Absolute.?
0006.0026 ---> Absolute.?
ff00.0001 ---> Sync.Report
ff00.0001 ---> Sync.Report
ff00.0001 ---> Sync.Report
ff00.0001 ---> Sync.Report
ff00.0001 ---> Sync.Report
ff00.0001 ---> Sync.Report
ff00.0001 ---> Sync.Report

[Q] Ouya USB HID commands for buttons | XDA Forums