From 8a2585f8dcff8fb7de68e72e2c2496e660b9033d Mon Sep 17 00:00:00 2001 From: Aaron Kling Date: Fri, 13 Jan 2017 18:37:50 -0600 Subject: [PATCH] Handle motion events if source is touchscreen or mouse regardless of other sources being set. API level 9 doesn't support stylus, but still needs to be handled. Current code throws out additional sources that it doesn't recognize. This instead ignores whether other sources are set. --- input/drivers/android_input.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/input/drivers/android_input.c b/input/drivers/android_input.c index b9f494f6ec..5d2ece5300 100644 --- a/input/drivers/android_input.c +++ b/input/drivers/android_input.c @@ -503,7 +503,8 @@ static INLINE int android_input_poll_event_type_motion( size_t motion_ptr; bool keyup; - if (source & ~(AINPUT_SOURCE_TOUCHSCREEN | AINPUT_SOURCE_MOUSE)) + // Only handle events from a touchscreen or mouse + if (!(source & (AINPUT_SOURCE_TOUCHSCREEN | AINPUT_SOURCE_MOUSE))) return 1; getaction = AMotionEvent_getAction(event);