# 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. # # Wii Remote (WiiMote), Nunchuk and Classic Controller. # WiiMote and Nunchuck buttons mostly map to codes based on their labels. # Classic controller buttons map to mimic Xbox 360 controller layout. # # NVIDIA Normalized Gamepad # WiiMote buttons # D-pad buttons map as expected. key 0x67 DPAD_UP key 0x69 DPAD_LEFT key 0x6a DPAD_RIGHT key 0x6c DPAD_DOWN # Button "A" (on the front) maps to BUTTON_A. key 0x1c BUTTON_A # Button "B" (on the back) maps to BUTTON_B. key 0x9e BUTTON_B # Button "-" maps to BACK. key 0x161 BACK # Button "+" maps to BUTTON_START. key 0x9f BUTTON_START # Button with home icon maps to HOME. key 0x66 HOME # Button "1" maps to BUTTON_X. key 0x94 BUTTON_X # Button "2" maps to BUTTON_Y. key 0x95 BUTTON_Y # Wiimote D-pad axes are currently disabled in WiiMote config. #axis 0x12 GENERIC_3 #axis 0x13 GENERIC_4 # Nunchuk buttons # Button "C" maps to BUTTON_C. key 0x132 BUTTON_C # Button "Z" maps to BUTTON_Z. key 0x135 BUTTON_Z # Nunchuk Axes axis 0x1a RX # Nunchuk is currently configured to emit non-inverted Y axis - invert it here. # This has to be kept in sync with WiiMote config. axis 0x1b invert RY # Classic Controller Buttons # All buttons map to logical codes correspondent to button layout, # using Microsoft X-Box and Logitech F310/F710 as a reference. # D-pad buttons map as expected, but are currently disabled in WiiMote config. #key 0x101 DPAD_UP #key 0x102 DPAD_DOWN #key 0x103 DPAD_LEFT #key 0x104 DPAD_RIGHT # Button "a" maps to BUTTON_B, due to placement analogy. key 0x130 BUTTON_B # Button "b" maps to BUTTON_A, due to placement analogy. key 0x131 BUTTON_A # Button "x" maps to BUTTON_Y, due to placement analogy. key 0x133 BUTTON_Y # Button "y" maps to BUTTON_X, due to placement analogy. key 0x134 BUTTON_X # Button "L" maps to BUTTON_L1. key 0x136 BUTTON_L1 # Button "R" maps to BUTTON_R1. key 0x137 BUTTON_R1 # Button "ZL" maps to BUTTON_L2. key 0x138 BUTTON_L2 # Button "ZR" maps to BUTTON_R2. key 0x139 BUTTON_R2 # Button "-" maps to BACK. key 0x13a BACK # Button "+" maps to BUTTON_START. key 0x13b BUTTON_START # Button with home icon maps to HOME. key 0x13c HOME # Left (0x00, 0x01) and right (0x02, 0x05) analog control stick. # (Each axis has range from 0 to 63, but in reality they don't go beyond 55 or so.) axis 0x00 X axis 0x01 Y axis 0x02 Z axis 0x05 RZ # Hat. # (D-pad is reported as analog. Each axis has range from -1 to 1.) axis 0x10 HAT_X axis 0x11 HAT_Y # Classic upper L/R buttons are currently disabled in Wiimote config, # as they report only 0 or 1 instead of full range of trigger motion. #axis 0x03 LTRIGGER #axis 0x04 RTRIGGER