We are still missing a key layout for the original xbox controller with
product id 02dd. Add the missing layout here.
Bug: 140808513
Test: manual test by plugging in the actual joystick and using the
custom tester app
Change-Id: Ib84e3ac04ff58f890ce7743423cc9b869af347db
The Xbox controller (product id 0x02fd) is going to have a new firmware
update this fall that sends a different keycode (316/BUTTON_MODE) for
the Xbox button. The goal is to enable the Xbox button to make it to
apps on all Android versions -- with our without a controller-specific
key mapping file.
Unfortunately, the new Vendor_045e_Product_02fd.kl key mapping file
that was added to Android Q maps the pre-firmware-update
Xbox key code (172) to BUTTON_MODE, yet it makes no mention of key 316.
This results in apps getting a raw 316 scan code instead of
a BUTTON_MODE KeyEvent when using a controller with the latest firmware
on Android Q.
The fix is to add an additional key mapping for 316 that *also* maps to
BUTTON_MODE. With both mappings in place, both pre and post
firmware-updated controllers will get the correct behavior for the
Xbox button on Android Q.
Test: AFAIK, no CTS tests exist for Xbox controller key mappings;
we'll need to add some at a later date. I was unable to test this
change because I'm unable to write to the system directory on any
of my devices, but I know that mapping 316 to BUTTON_MODE will
fix the issue.
Signed-off-by: Jared Henderson <jaredh.microsoft@gmail.com>
Bug: 139512030
Bug: 140808513
Merged-In: I8600ea79a0aa8557267d6ca712e5d56680e7a98b
Change-Id: I8600ea79a0aa8557267d6ca712e5d56680e7a98b
The Xbox controller (product id 0x2fd) is going to have a new firmware update this fall that sends a different keycode (316/BUTTON_MODE) for the Xbox button. The goal is to enable the Xbox button to make it to apps on all Android versions -- with our without a controller-specific key mapping file.
Unfortunately, the new Vendor_045e_Product_02fd.kl key mapping file that was added to Android Q maps the pre-firmware-update Xbox key code (172) to BUTTON_MODE, yet it makes no mention of key 316. This results in apps getting a raw 316 scan code instead of a BUTTON_MODE KeyEvent when using a controller with the latest firmware on Android Q.
The fix is to add an additional key mapping for 316 that *also* maps to BUTTON_MODE. With both mappings in place, both pre and post firmware-updated controllers will get the correct behavior for the Xbox button on Android Q.
Test: AFAIK, no CTS tests exist for Xbox controller key mappings; we'll need to add some at a later date. I was unable to test this change because I'm unable to write to the system directory on any of my devices, but I know that mapping 316 to BUTTON_MODE will fix the issue.
Change-Id: I8600ea79a0aa8557267d6ca712e5d56680e7a98b
Signed-off-by: Jared Henderson <jaredh.microsoft@gmail.com>
Bug: 139372370
We are currently missing the key layout for the Xbox One USB controller
with the following meta information:
vendor 045e, product 02ea
This layout was copied from product 02d1.
Also fix the mappings of the middle buttons to generate "select - mode -
start", similar to what has already been done for the other xbox
controllers in ag/4836521 and ag/3162575
Bug: 132451971
Bug: 133514907
Bug: 139512030
Test: tested using custom app. CTS tests will be added later.
Change-Id: Ie18bce987b512211d3e91bd1f7334afe11d83cf8
Merged-In: Ie18bce987b512211d3e91bd1f7334afe11d83cf8
Add layout for Xbox elite controller
Test: tested with a custom app
Bug: 132451971
Bug: 139512030
Change-Id: I1c600bc2c41db9d79d7a4e184ef41abe2b5f860e
Merged-In: I1c600bc2c41db9d79d7a4e184ef41abe2b5f860e
Linux has defined KEY_ASSISTANT, but it is not currently mapped in
Android by default. Add the missing mapping here.
Bug: None
Test: None
Change-Id: I85dfecf599ebb69dd2b9ac602b1fc425e13f93c4
The controller for Nintendo Switch is currently missing a key layout,
and the resulting codes are incorrect. Provide the appropriate map here.
Also, update some button mappings for the Xbox 360 controller.
Bug: 135136477
Test: Tested using "gamepad tester". CTS test will be added in a future
release. Tested using custom app.
Change-Id: I1ffcabdcc11aa83316c483ea49cb10fc85f6264f
We are currently missing the key layout for the Xbox One USB controller
with the following meta information:
vendor 045e, product 02ea
This layout was copied from product 02d1.
Also fix the mappings of the middle buttons to generate "select - mode -
start", similar to what has already been done for the other xbox
controllers in ag/4836521 and ag/3162575
Bug: 132451971
Bug: 133514907
Test: tested using 'gamepadtester'. CTS tests will be added later.
Change-Id: Ie18bce987b512211d3e91bd1f7334afe11d83cf8
All buttons and axes on DualShock3 and DualShock4 are mapped
explicitly, because some Linux drivers do not map them correctly.
Also, the definition of BUTTON_X/Y in Linux and Android is flipped.
The most significant bit (i.e. 0x8000 and 0x8111) in the "Version"
part of the filename indicates a newer Linux hid-sony driver (>=4.10
for DualShock4 and >=4.12 for DualShock3) which complies to the
mapping in Linux gamepad specifications, and supports all DualShock4
features (i.e. motions sensors, touchpad).
Older Linux driver which does not have the correct mapping will use
the mapping files without "Version".
All files with "Version_8000" and "Version_8100" are meant for
Bluetooth connected DualShock3/DualShock4, and all files with
"Version_8111" are meant for USB connected DualShock3/DualShock4.
Test: Connect DualShock3 and DualShock4, over USB and over Bluetooth.
Test: Check that the Dpad and left analog stick can be used to
navigate the UI.
Test: If newer Linux driver is loaded, check that the touchpad can
be used to navigate the UI.
Bug: 38511270
Change-Id: I5630c495af16185689bbff25943b3e2d3c93e709
Currently, the circle button on odie (Asus Gamepad) is mapped to HOME.
But it is not clear which button is which just from looking at the key
layout file.
Add some annotations here.
Bug: 111431828
Bug: 110270125
Test: atest AsusGamepadTestCase (the test is currently in development)
Change-Id: I8d1317be7f403ceaf0c2d72d756623e3cd032559
Currently, BUTTON_MODE falls back to MENU.
It is not clear which functionality relies on that. However, many
joysticks currently map their "branded" button, for example, the "XBOX"
key on the Xbox joystick, and "PS" key on the playstation joystick, to
the BUTTON_MODE. On other joysticks, the same button is mapped to
"HOME". So it would make sense to have this button to fall back to HOME
in order to make the behaviour consistent.
Also, remap the "XBOX" button on the Xbox controller to "BUTTON_MODE".
This would give apps the chance to intercept this key and actually use
it, instead of limiting it to the system.
Bug: 37115804
Bug: 77803694
Test: Made a test app to dump out joystick events in response to
dispatchKeyEvent. Then either returned true or false to ensure that the
fallback happens. If returning true, the app has handled the event, and
HOME is not dispatched. If returning false, the app does not care about
the event. Therefore, HOME is generated and the phone goes to home
screen (so the app gets closed).
Change-Id: I023620551f52d34638303db60f8a4ca37f06d4d8
Merged-In: I023620551f52d34638303db60f8a4ca37f06d4d8
In an earlier commit, ag/4071802, (Change-Id:
I33e922a2c52582f44d65f20024d7dca1f9d05a5e), this particular file was
overlooked.
Quick fix here to make everything consistent. We will add the other
variants of these devices in the future.
Test: partial cherry-pick from Sony CL on aosp
Bug: 79881694
Change-Id: I8ab46fde8650724464b1e799cd948682c56e5b52
Merged-In: I8ab46fde8650724464b1e799cd948682c56e5b52
Currently, BUTTON_MODE falls back to MENU.
It is not clear which functionality relies on that. However, many
joysticks currently map their "branded" button, for example, the "XBOX"
key on the Xbox joystick, and "PS" key on the playstation joystick, to
the BUTTON_MODE. On other joysticks, the same button is mapped to
"HOME". So it would make sense to have this button to fall back to HOME
in order to make the behaviour consistent.
Also, remap the "XBOX" button on the Xbox controller to "BUTTON_MODE".
This would give apps the chance to intercept this key and actually use
it, instead of limiting it to the system.
Bug: 37115804
Bug: 77803694
Test: Made a test app to dump out joystick events in response to
dispatchKeyEvent. Then either returned true or false to ensure that the
fallback happens. If returning true, the app has handled the event, and
HOME is not dispatched. If returning false, the app does not care about
the event. Therefore, HOME is generated and the phone goes to home
screen (so the app gets closed).
Change-Id: I023620551f52d34638303db60f8a4ca37f06d4d8
In an earlier commit, ag/4071802, (Change-Id:
I33e922a2c52582f44d65f20024d7dca1f9d05a5e), this particular file was
overlooked.
Quick fix here to make everything consistent. We will add the other
variants of these devices in the future.
Test: partial cherry-pick from Sony CL on aosp
Bug: 79881694
Change-Id: I8ab46fde8650724464b1e799cd948682c56e5b52
Currently, the PS key on the DS4 joystick maps to HOME, which means that
this key will not be delivered to apps. However, such apps as Remote
Play require access to this key for proper operation.
Map it to BUTTON_MODE here to allow the apps to handle it. Also, map the
touchpad click to BUTTON_1, which is a generic gamepad button.
The mapping to HOME is not specified in Android. By the Linux
spec, it is more correct to generate BUTTON_MODE for this button (even
though it is drawn slighly above the two sticks in the spec, and it is
physically located more in-line or slightly below these).
The historical reason for this mapping was the fact that
the touchpad generated a click, which meant that touchpad click was more
aligned with the Linux spec. In addition, on some other controllers,
this button actually has a "house" drawn on it, which
would make it consistent with "HOME", and it is currently mapped to
HOME. On this (and several others) joystick, however, there is no such
drawing, and BUTTON_MODE is appropriate.
In Q, this will be addressed by changing the branded buttons on other
controllers to also generate "BUTTON_MODE", and then changing the
Generic fallback mapping for BUTTON_MODE to HOME.
Bug: 79881694
Test: connected DS4 joystick. Made a test app that overrides
dispatchKeyEvent and dumps out every event to the logcat. Then pressed
every button to ensure that the keys are generated as expected. In the
long run, this will be tested in the CTS test
input.cts.tests.AsusGamepadTestCase.
Change-Id: I33e922a2c52582f44d65f20024d7dca1f9d05a5e
If the validation of keylayouts / keycharmaps / keyconfigs succeeds, do
not log anything to reduce logspam. The "-q" argument was misplaced in
the original CL.
Bug: 35672363
Test: touch frameworks/base/data/keyboards/Vendor_045e_Product_028e.kl && m
Also, change the behaviour in tools/validatekeymaps/Main.cpp to always
ignore "-q", see that the logs come back.
Change-Id: I3cd2ef161942905c2d8ffce8fc93dd345868066d
Android devices with a physical keyboard connected may not have a
way to execute the "Back Behaviour" without using a touchscreen
or pointer. This adds a ctrl-alt-backspace mapping to the
back behaviour, similar to TalkBalk.
Use cases include Pixel C, accessibility situations where
touchscreens are not convenient or feasible, or other phones/tablets
with a hardware keyboard attached and keyboard only interaction is
desired.
Previous to http://ag/3540362, ESC provided this functionality.
Bug: 71907807
Test: Manual testing on Marlin
Change-Id: I5015a17add26824a40e5eac1bced8e9ca7b98efa
The escape key has a fallback "back" behaviour. On ChromeOS
or tablets with bluetooth/attached keyboards, pressing the ESC
key can unexpectedly close applications. This removes the
fallback mapping so that ESC does nothing.
Bug: 71907807
Test: Manual testing on Marlin
Change-Id: I747f0bd743ec117e6ae47fae527600a3ab5690ba
Generic.kl is a special file that defines the default mappings for all
devices. There can only be one and it cannot change regardless of the
product area the device is in. This should *never* have been checked in,
especially not without someone on the input team looking at it.
Also, add support for the POUND and STAR keys, which is why it was
forked in the first place.
Test: N/A
Change-Id: I894cbefe20fc77d827dc500daa3a380f252eb8b6
When connected over bluetooth, the device
registers with vendorId=045e, productId=02e0.
Add the keylayout for this here.
Bug: 37115804
Bug: 37115820
Test: connect the controller, use
'getevent' to keep track of the generated events
Change-Id: Ia4b80e54a547e5d6716ff0f83b068e4cc87dfbb0
This file is a copy of Vendor_054c_Product_09cc.kl,
which is a v2 version of the same joystick.
They have the same layout.
Bug: 36693940
Test: mapped with getevent, works OK
Change-Id: I439caf97f2c51d643753e1fc8d5dd0213131927a
Adds a quiet option to validatekeyamps and uses it for the platform
build.
Bug: 35672363
Test: m -j12; see no messages about succesful keymap validation
Change-Id: I902a9f5813ae612ee48ee3df210ae8fa2988c4b3
A following change will update the InputDriver-JNI
to take advantage of the new keys.
Bug: 64083153
Test: Building source and testing with InputDriver
Change-Id: I94c9d59ecf7f7278f2ec61c68c4eb80aa65f142c
The SLEEP keycode is used by Android Wear to indicate a
"palming" gesture (covering the screen with one's hand).
The STEM_* buttons are used for side buttons on Wear.
The keycode values were added to the emulator in
http://r.android.com/330771
Bug: 19996432
Change-Id: Ib90c3b27209b0059ebc1c2cce46cc732a677d557
Add characters to the keyboard mapping to allow them
to be entered into the AVD from the developer's PC
keyboard.
This mapping supports the non-ASCII keys that appear
on the "US International" keyboard. Most of the Latin-1
characters (but not all) appear on this keyboard.
This change does not remove support for any keys.
b.android.com/200042
Change-Id: I65d54eb36183382b171c388b26848941eb0ff8d9
(cherry picked from commit dac57966a9)
Add the App Switch (Recents) key.
Add media control keys.
These are needed to support Emulator UI
buttons for these functions.
Change-Id: I3e9479bb49e21400f7bfd1435c50886038bbe0ff
Add the App Switch (Recents) key.
Add media control keys.
These are needed to support Emulator UI
buttons for these functions.
Change-Id: I5d5d25a77625bfd831cf7b31c126fd342efc6c5b
Turns out they produce an SNES controller with the same VID/PID as
their NES controller. Just remap both at once.
Change-Id: Iba94fdd69fd846f99ca1b3205de9069989635c73