Siarhei Vishniakou | 94db68e | 2019-06-12 09:59:59 -0700 | [diff] [blame] | 1 | # Copyright (C) 2019 The Android Open Source Project |
| 2 | # |
| 3 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | # you may not use this file except in compliance with the License. |
| 5 | # You may obtain a copy of the License at |
| 6 | # |
| 7 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | # |
| 9 | # Unless required by applicable law or agreed to in writing, software |
| 10 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | # See the License for the specific language governing permissions and |
| 13 | # limitations under the License. |
| 14 | |
| 15 | # |
| 16 | # Nintendo Switch Pro Controller - HAC-013 - Bluetooth |
| 17 | # |
| 18 | |
| 19 | |
| 20 | # Mapping according to https://developer.android.com/training/game-controllers/controller-input.html |
| 21 | |
| 22 | # Button labeled as "Y" but should really produce keycode "X" |
| 23 | key 0x132 BUTTON_X |
| 24 | # Button labeled as "B" but should really produce keycode "A" |
| 25 | key 0x130 BUTTON_A |
| 26 | # Button labeled as "A" but should really produce keycode "B" |
| 27 | key 0x131 BUTTON_B |
| 28 | # Button labeled as "X" but should really product keycode "Y" |
| 29 | key 0x133 BUTTON_Y |
| 30 | |
| 31 | # Button labeled as "L" |
| 32 | key 0x134 BUTTON_L1 |
| 33 | # Button labeled as "R" |
| 34 | key 0x135 BUTTON_R1 |
| 35 | |
| 36 | # No LT / RT axes on this controller. Instead, there are keys. |
| 37 | # Trigger labeled as "ZL" |
| 38 | key 0x136 BUTTON_L2 |
| 39 | # Trigger labeled as "ZR" |
| 40 | key 0x137 BUTTON_R2 |
| 41 | |
| 42 | # Left Analog Stick |
| 43 | axis 0x00 X |
| 44 | axis 0x01 Y |
| 45 | # Right Analog Stick |
| 46 | axis 0x03 Z |
| 47 | axis 0x04 RZ |
| 48 | |
| 49 | # Left stick click (generates linux BTN_SELECT) |
| 50 | key 0x13a BUTTON_THUMBL |
| 51 | # Right stick click (generates linux BTN_START) |
| 52 | key 0x13b BUTTON_THUMBR |
| 53 | |
| 54 | # Hat |
| 55 | axis 0x10 HAT_X |
| 56 | axis 0x11 HAT_Y |
| 57 | |
| 58 | # Mapping according to https://www.kernel.org/doc/Documentation/input/gamepad.txt |
| 59 | # Minus |
| 60 | key 0x138 BUTTON_SELECT |
| 61 | # Plus |
| 62 | key 0x139 BUTTON_START |
| 63 | |
| 64 | # Circle |
| 65 | key 0x13d BUTTON_MODE |
| 66 | |
| 67 | # Home key |
| 68 | key 0x13c HOME |