diff options
author | 2018-06-08 21:17:33 +0100 | |
---|---|---|
committer | 2018-07-03 17:46:23 +0100 | |
commit | a62a8dd15e3deb4622e3ee8fd844999cf4fafc41 (patch) | |
tree | d7dd861bc5223a1e7b88772fa57e523e4f0f49db /libs/input/KeyCharacterMap.cpp | |
parent | 62ce5753d8ac20feeb3681e725388700d9c87e27 (diff) |
Move displayid into InputEvent
There are certain use cases where key events should be associated with a
particular display. Refactor KeyEvent and MotionEvent to have an
associated display id.
Remove "hasAssociatedDisplay" variable from KeyboardInputMapper,
it just used to mirror "isOrientationAware".
If the keyboard is orientation aware (= it is physically attached to a
display, and therefore rotates together with that display), then
associate that keyboard with the internal viewport. Otherwise, the key
events are not associated with any particular display.
Remaining to do:
- make mInternalDisplay, mExternalDisplay, mVirtualDisplays into a
single vector with type (internal, external, virtual)
- have getDisplayViewport return std::optional (will require deep
changes)
Bug: 64258305
Test: atest inputflinger_tests libinput_tests
Change-Id: I4fe145e74cb59310efaa55bfc9dc3c2b3bd997e3
Diffstat (limited to 'libs/input/KeyCharacterMap.cpp')
-rw-r--r-- | libs/input/KeyCharacterMap.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libs/input/KeyCharacterMap.cpp b/libs/input/KeyCharacterMap.cpp index cba1111606..b561b605b4 100644 --- a/libs/input/KeyCharacterMap.cpp +++ b/libs/input/KeyCharacterMap.cpp @@ -487,7 +487,7 @@ void KeyCharacterMap::addKey(Vector<KeyEvent>& outEvents, int32_t deviceId, int32_t keyCode, int32_t metaState, bool down, nsecs_t time) { outEvents.push(); KeyEvent& event = outEvents.editTop(); - event.initialize(deviceId, AINPUT_SOURCE_KEYBOARD, + event.initialize(deviceId, AINPUT_SOURCE_KEYBOARD, ADISPLAY_ID_NONE, down ? AKEY_EVENT_ACTION_DOWN : AKEY_EVENT_ACTION_UP, 0, keyCode, 0, metaState, 0, time, time); } |