Kim Low | 0a5109d | 2017-04-04 13:32:19 -0700 | [diff] [blame] | 1 | # Copyright (C) 2018 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 | # Sony Playstation(R) DualShock 4 Controller |
| 17 | # - Version 0x8111 is for Linux hid-sony driver >=4.10 and when |
| 18 | # connected over USB |
| 19 | # |
| 20 | |
| 21 | |
| 22 | # Mapping according to https://developer.android.com/training/game-controllers/controller-input.html |
| 23 | |
| 24 | # Square |
| 25 | key 0x134 BUTTON_X |
| 26 | # Cross |
| 27 | key 0x130 BUTTON_A |
| 28 | # Circle |
| 29 | key 0x131 BUTTON_B |
| 30 | # Triangle |
| 31 | key 0x133 BUTTON_Y |
| 32 | |
| 33 | key 0x136 BUTTON_L1 |
| 34 | key 0x137 BUTTON_R1 |
| 35 | key 0x138 BUTTON_L2 |
| 36 | key 0x139 BUTTON_R2 |
| 37 | |
| 38 | # L2 axis |
| 39 | axis 0x02 LTRIGGER |
| 40 | # R2 axis |
| 41 | axis 0x05 RTRIGGER |
| 42 | |
| 43 | # Left Analog Stick |
| 44 | axis 0x00 X |
| 45 | axis 0x01 Y |
| 46 | # Right Analog Stick |
| 47 | axis 0x03 Z |
| 48 | axis 0x04 RZ |
| 49 | |
| 50 | # Left stick click |
| 51 | key 0x13d BUTTON_THUMBL |
| 52 | # Right stick click |
| 53 | key 0x13e BUTTON_THUMBR |
| 54 | |
| 55 | # Hat |
| 56 | axis 0x10 HAT_X |
| 57 | axis 0x11 HAT_Y |
| 58 | |
| 59 | # Mapping according to https://www.kernel.org/doc/Documentation/input/gamepad.txt |
| 60 | # Share |
| 61 | key 0x13a BUTTON_SELECT |
| 62 | # Options |
| 63 | key 0x13b BUTTON_START |
| 64 | # PS key |
| 65 | key 0x13c BUTTON_MODE |
| 66 | |
| 67 | # In kernel versions >= 4.10, the touchpad is a separate input device, |
| 68 | # so the touchpad button click will not be covered by this layout. |