blob: bc6fc3b5e455b52bbd3130418a8b50517565a7e2 [file] [log] [blame]
Kim Low0a5109d2017-04-04 13:32:19 -07001# 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 USB Dongle
17#
18
19
20# Mapping according to https://developer.android.com/training/game-controllers/controller-input.html
21
22# Square
23key 0x130 BUTTON_X
24# Cross
25key 0x131 BUTTON_A
26# Circle
27key 0x132 BUTTON_B
28# Triangle
29key 0x133 BUTTON_Y
30
31key 0x134 BUTTON_L1
32key 0x135 BUTTON_R1
33key 0x136 BUTTON_L2
34key 0x137 BUTTON_R2
35
36# L2 axis
37axis 0x03 LTRIGGER
38# R2 axis
39axis 0x04 RTRIGGER
40
41
42# Left Analog Stick
43axis 0x00 X
44axis 0x01 Y
45# Right Analog Stick
46axis 0x02 Z
47axis 0x05 RZ
48
49# Left stick click
50key 0x13a BUTTON_THUMBL
51# Right stick click
52key 0x13b BUTTON_THUMBR
53
54# Hat
55axis 0x10 HAT_X
56axis 0x11 HAT_Y
57
58# Mapping according to https://www.kernel.org/doc/Documentation/input/gamepad.txt
59# Share
60key 0x138 BUTTON_SELECT
61# Options
62key 0x139 BUTTON_START
63# PS key
64key 0x13c BUTTON_MODE
65
66# Touchpad press
67# The touchpad for this joystick will become a separate input device in future releases
68# and this button will be equivalent to left mouse button
69# Therefore, map it to KEYCODE_BUTTON_1 here to allow apps to still handle this on earlier versions
70key 0x13d BUTTON_1