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.
This commit is contained in:
Aaron Kling 2017-01-13 18:37:50 -06:00
parent c162f21f9a
commit 8a2585f8dc

View File

@ -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);