Commit Graph

108 Commits

Author SHA1 Message Date
Kim Low
819e7528ee Merge "Added mapping files for DualShock3 and DualShock4" am: 85aadab7e4 am: d050a2edd6
am: 1f6af2e769

Change-Id: I239e8e9aff10e7472fb841261df7e23466202dd2
2018-09-19 18:05:08 -07:00
Kim Low
0a5109d955 Added mapping files for DualShock3 and DualShock4
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
2018-09-13 10:28:17 -07:00
Siarhei Vishniakou
7b0b609beb Add comments to Asus Gamepad button mappings
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
2018-08-29 10:46:23 -07:00
Siarhei Vishniakou
0b607447b6 Fallback BUTTON_MODE to HOME
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
2018-08-27 15:53:33 -07:00
Siarhei Vishniakou
bfb5b8b03e Remap PS key to BUTTON_MODE
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
2018-08-27 15:51:48 -07:00
Siarhei Vishniakou
da16f224b7 Fallback BUTTON_MODE to HOME
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
2018-08-21 18:30:16 -07:00
Siarhei Vishniakou
bf2f882a9c Remap PS key to BUTTON_MODE
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
2018-07-17 16:37:29 +01:00
Siarhei Vishniakou
867968530e Remap PS key to BUTTON_MODE on DS4 joystick
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
2018-05-17 09:39:04 -07:00
Siarhei Vishniakou
ae911cb8ae Suppress key validation logs
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
2018-03-26 16:59:47 -07:00
Emilie Roberts
1ab70f3b37 Merge "Remove ESC key fallback mapping" 2018-02-07 22:03:38 +00:00
Emilie Roberts
3abea7fe3f Add Ctrl-Alt-Backspace to Back mapping
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
2018-01-31 18:53:58 +00:00
Emilie Roberts
16d42def25 Remove ESC key fallback mapping
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
2018-01-31 16:46:46 +00:00
Yuichiro Hanada
c1415f3e3c Add new refresh key constant.
Bug: 64149858
Bug: 64662317
Test: Builds and manual tests with Chromebook.

Change-Id: I865d657ee7d78b5e45f642e786d26a65a14f49e1
2018-01-24 09:11:49 +09:00
Michael Wright
4cb42f3894 There is only one Generic.kl.
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
2017-12-05 18:45:41 +00:00
Michael Wright
9fc31ee1f8 Add OWNERS to system_server services.
Test: N/A
Change-Id: I60174fcbbf2a061df2961239ec1b45df2e6b20ed
2017-11-21 18:35:16 +00:00
Siarhei Vishniakou
46429ecd93 Add keylayout for xbox controller over bt
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
2017-11-02 19:45:31 -07:00
Siarhei Vishniakou
c8f4acb6ba Add keylayout file for Sony DS4 v1 joystick
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
2017-09-12 15:19:26 -07:00
Siarhei Vishniakou
4dc796f180 Merge "Add keylayout file for Sony DS4 joystick." 2017-09-11 18:18:33 +00:00
Michael Wright
7185881062 Quiet keymap validation.
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
2017-09-04 15:18:44 +01:00
Nick Felker
be1d81195a Adds POUND and STAR keys to Generic_Iot.kl
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
2017-08-02 16:49:26 +00:00
Siarhei Vishniakou
ccdc8c1c8a Add keylayout file for Sony DS4 joystick.
Bug: 36693940
Test: mapped with getevent, works OK
Change-Id: I3c397914bbd874221d87bd77cbc1c9fe5f27336f
2017-06-27 18:39:10 -07:00
Nimrod Gileadi
9576ce6696 Add Wear keycodes to emulator key layout file.
am: 119a06ce55

Change-Id: I33d2b0f9b8281c22422677f03d6046a1be0bd94f
2017-02-01 17:57:16 +00:00
Nimrod Gileadi
119a06ce55 Add Wear keycodes to emulator key layout file.
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
2017-02-01 12:13:12 +00:00
Jim Kaye
d3a460233f Support keyboard entry of non-ASCII characters
am: b57679e2e7

* commit 'b57679e2e7fb6f133f6fe373d8036b74866476d8':
  Support keyboard entry of non-ASCII characters
2016-03-02 19:06:34 +00:00
Jim Kaye
b57679e2e7 Support keyboard entry of non-ASCII characters
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)
2016-03-02 18:56:10 +00:00
Michael Wright
584e8d11a8 Merge "Add keylayout for Xbox One controller" am: 7416762be0
am: 605d619b1e

* commit '605d619b1eeef901661c9536b7921ac47960d110':
  Add keylayout for Xbox One controller
2016-02-17 22:55:10 +00:00
Tim Clark
66a25396b0 Add keylayout for Xbox One controller
Change-Id: Ifb4005ed7b6345c9af126d8f1bd22c7e2921871f
2016-02-17 17:26:06 +00:00
Jim Kaye
e579edc76b Merge "Extend the \'qwerty\' key layout"
am: 9a83f115ad

* commit '9a83f115ade900a816f0fa2beae2cdd6f54bfc54':
  Extend the 'qwerty' key layout
2015-11-24 19:33:57 +00:00
Jim Kaye
b45d99d7d9 Extend the 'qwerty' key layout
Add the App Switch (Recents) key.
Add media control keys.

These are needed to support Emulator UI
buttons for these functions.

Change-Id: I3e9479bb49e21400f7bfd1435c50886038bbe0ff
2015-11-23 12:22:59 -08:00
Jim Kaye
5b77f70d8b Extend the 'qwerty' key layout
Add the App Switch (Recents) key.
Add media control keys.

These are needed to support Emulator UI
buttons for these functions.

Change-Id: I5d5d25a77625bfd831cf7b31c126fd342efc6c5b
2015-11-20 09:59:25 -08:00
Michael Wright
f6d7c67962 Add kernel keycode mapping for new cut / copy / paste keys
Bug: 25120948
Change-Id: I33a93fa6c067d15a9739ca33703e0e48e8cf6eff
2015-10-22 15:54:02 +01:00
Michael Wright
04fc7b7510 Fix broken KL file.
Buttons should be L1 and R1 instead of L and R.

Change-Id: I1e345f7e28ad6b47248656a7f79d5507c62aa007
2015-10-13 14:13:33 +01:00
Michael Wright
c51179e9ab Update NES controller key layout
Turns out they produce an SNES controller with the same VID/PID as
their NES controller. Just remap both at once.

Change-Id: Iba94fdd69fd846f99ca1b3205de9069989635c73
2015-10-13 12:34:05 +00:00
Puneet Kumar
f975a26bfe am d621ee11: am edc3585f: am 0a1f0e56: Merge "Add ESC mapping for Pixel C keyboard" into mnc-dr-dev
* commit 'd621ee11fa76d7dd803a802bf000baa591c84fbe':
  Add ESC mapping for Pixel C keyboard
2015-10-08 09:20:01 +00:00
Puneet Kumar
2a370c4932 am 0068ea5b: am 8810285f: am 06d1254c: Merge "Add layout and keymap for Pixel C Bluetooth keyboard" into mnc-dr-dev
* commit '0068ea5bf7c9988174b0991eb87bb09f5838c39c':
  Add layout and keymap for Pixel C Bluetooth keyboard
2015-10-08 09:19:55 +00:00
Dmitry Torokhov
a43a96be9e Add ESC mapping for Pixel C keyboard
Now that we have "replace" key event support in the framework we can map
ESC as AltR+1.

Bug: 24504154

Change-Id: Ief8a50098fc5484171011f268ffc22a309cbba62
2015-09-29 13:31:18 -07:00
Dmitry Torokhov
4608f10849 Add layout and keymap for Pixel C Bluetooth keyboard
This adds special layout and character map for Pixel C keyboard (Dragon
base) that lacks several keys, such as ESC, bracket keys, tilda and
backslash, which are mapped various Alt-R combinations.

Currently we map:

 [Shift]+AltR+2 -> ~ and `
 [Shift]+AltR+O -> { and [
 [Shift]+AltR+P -> } and ]
 [Shift]+AltR+= -> | and \

ESC mapping requires additional changes.

Bug: 24504154

Change-Id: I24fc68efe7e2ddebee26a273838443b441491857
2015-09-29 13:30:59 -07:00
Ying Wang
9f8ec39d11 am e8d735c7: Merge "Remove all_modules\'s dependency on keymaps validation."
* commit 'e8d735c70a594abdfbf9ff16ef2ccfc9b87a3635':
  Remove all_modules's dependency on keymaps validation.
2015-05-06 22:56:04 +00:00
Ying Wang
366d6d0d12 Remove all_modules's dependency on keymaps validation.
With this we won't try to run validatekeymaps.exe when you run
"USE_MINGW=1 mma".
Also it seems it's too much to run the validation for every mma/mmma.
Validation in just platform build (droidcore) should be enough.

Change-Id: I22431009d4c2dd765bbd14b24eb5c8729b53d6c1
2015-05-05 16:12:41 -07:00
Michael Wright
e72a657561 Mark AVRCP devices as internal.
This prevents devices from waking up when an AVRCP key is injected.

Bug: 19685657
Change-Id: I97137531da07b61211b792b407c4c9a09b231839
2015-03-11 17:23:09 -07:00
Michael Wright
c859b85cb5 Merge "Added Razer USA, Ltd serval" 2014-12-01 23:47:37 +00:00
Mathieu Meisser
ad66d7d2c1 Add keylayout for Logitech RedHawk Gamepad
Change-Id: Iad03de3384052b360d6b9d887ca9540de68cd21e
2014-11-27 00:46:01 +01:00
Stuart Wells
7e1435ec3c Added Razer USA, Ltd serval
Change-Id: I76b7c36068c3d10ab4acb3123550ef115db0d3d2
2014-11-17 10:28:47 -08:00
Michael Wright
5ba44281c7 Add keylayout for Asus Gamepad
Bug: 17627642
Change-Id: I9dd76bbc3ea0493d5a54479ef4dc94c520e35433
2014-09-23 16:04:35 -07:00
Michael Wright
b1e3b70aeb Remove Rhodi keylayout
Looks like Broadcom re-used the Rhodi PID since we never shipped.
Remove the keylayout so we don't accidentally use it for other
devices.

Bug: 17504946
Change-Id: Ia11ad40f8ba7d49f82e7f68d881cf7c9bfafcb37
2014-09-16 16:48:58 -07:00
Michael Wright
1ce304bb02 Map KEY_VOICECOMMAND to KEYCODE_VOICE_ASSIST
This is to simplify Project Watson requirements and enable USB Audio
to easily implement similar functionality to the Watson headsets.

Change-Id: Idd0a0cd6c6ba4a977090fb338d9241046f0380e6
2014-09-05 17:45:26 -07:00
Michael Wright
8111462d01 Add layout for OnLive controller with USB adapter
Change-Id: Ie21ba6550f62eb4797e0e51104b99c2a4a7c44d7
2014-05-30 12:27:00 -07:00
Michael Wright
725265a9c2 Add KL file for Logitech F310
Change-Id: I03f4fd74fb54571e2045b9289228150a348c994a
2014-05-21 15:39:24 -07:00
Michael Wright
11ad0e8bac am e8628797: am 09446329: am 52025796: Merge "Map KEY_APPSELECT to APP_SWITCH."
* commit 'e8628797833dfab1319d7a17f9ff465de760c633':
  Map KEY_APPSELECT to APP_SWITCH.
2014-05-02 22:15:06 +00:00
Michael Wright
e862879783 am 09446329: am 52025796: Merge "Map KEY_APPSELECT to APP_SWITCH."
* commit '09446329b1afbbc8b56885e61ed66841b59532b2':
  Map KEY_APPSELECT to APP_SWITCH.
2014-05-02 19:20:01 +00:00