blob: 3c6b11e4640cd40590b124be37535a5522d64b2f [file] [log] [blame]
Siarhei Vishniakou94db68e2019-06-12 09:59:59 -07001# 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
Siarhei Vishniakou94db68e2019-06-12 09:59:59 -070022# Button labeled as "B" but should really produce keycode "A"
23key 0x130 BUTTON_A
24# Button labeled as "A" but should really produce keycode "B"
25key 0x131 BUTTON_B
26# Button labeled as "X" but should really product keycode "Y"
27key 0x133 BUTTON_Y
Siarhei Vishniakou76baf212020-02-27 11:30:54 -080028# Button labeled as "Y" but should really produce keycode "X"
29key 0x134 BUTTON_X
Siarhei Vishniakou94db68e2019-06-12 09:59:59 -070030
31# Button labeled as "L"
Siarhei Vishniakou76baf212020-02-27 11:30:54 -080032key 0x136 BUTTON_L1
Siarhei Vishniakou94db68e2019-06-12 09:59:59 -070033# Button labeled as "R"
Siarhei Vishniakou76baf212020-02-27 11:30:54 -080034key 0x137 BUTTON_R1
Siarhei Vishniakou94db68e2019-06-12 09:59:59 -070035
36# No LT / RT axes on this controller. Instead, there are keys.
37# Trigger labeled as "ZL"
Siarhei Vishniakou76baf212020-02-27 11:30:54 -080038key 0x138 BUTTON_L2
Siarhei Vishniakou94db68e2019-06-12 09:59:59 -070039# Trigger labeled as "ZR"
Siarhei Vishniakou76baf212020-02-27 11:30:54 -080040key 0x139 BUTTON_R2
Siarhei Vishniakou94db68e2019-06-12 09:59:59 -070041
42# Left Analog Stick
43axis 0x00 X
44axis 0x01 Y
45# Right Analog Stick
46axis 0x03 Z
47axis 0x04 RZ
48
49# Left stick click (generates linux BTN_SELECT)
Siarhei Vishniakou76baf212020-02-27 11:30:54 -080050key 0x13d BUTTON_THUMBL
Siarhei Vishniakou94db68e2019-06-12 09:59:59 -070051# Right stick click (generates linux BTN_START)
Siarhei Vishniakou76baf212020-02-27 11:30:54 -080052key 0x13e BUTTON_THUMBR
Siarhei Vishniakou94db68e2019-06-12 09:59:59 -070053
Siarhei Vishniakou76baf212020-02-27 11:30:54 -080054# Currently, the dpad produces key events
55key 0x220 DPAD_UP
56key 0x221 DPAD_DOWN
57key 0x222 DPAD_LEFT
58key 0x223 DPAD_RIGHT
59
60# Hat - currently not being produced by hid-nintendo, but an upcoming patch set will change the behaviour.
61# Keep these mappings in anticipation of that change
Siarhei Vishniakou94db68e2019-06-12 09:59:59 -070062axis 0x10 HAT_X
63axis 0x11 HAT_Y
64
65# Mapping according to https://www.kernel.org/doc/Documentation/input/gamepad.txt
66# Minus
Siarhei Vishniakou76baf212020-02-27 11:30:54 -080067key 0x13a BUTTON_SELECT
68
Siarhei Vishniakou94db68e2019-06-12 09:59:59 -070069# Plus
Siarhei Vishniakou76baf212020-02-27 11:30:54 -080070key 0x13b BUTTON_START
Siarhei Vishniakou94db68e2019-06-12 09:59:59 -070071
72# Circle
Siarhei Vishniakou76baf212020-02-27 11:30:54 -080073key 0x135 BUTTON_MODE
Siarhei Vishniakou94db68e2019-06-12 09:59:59 -070074
75# Home key
76key 0x13c HOME