android: fix touch/stylus taps triggering mouse1 for compatibility

This commit is contained in:
rdb 2018-02-17 18:42:39 +01:00
parent 6bd1976892
commit 8dea93bf38

View File

@ -545,6 +545,9 @@ handle_motion_event(const AInputEvent *event) {
// The up event doesn't let us know which button is up, so we need to
// keep track of the button state ourselves.
int32_t button_state = AMotionEvent_getButtonState(event);
if (button_state == 0 && action == AMOTION_EVENT_ACTION_DOWN) {
button_state = AMOTION_EVENT_BUTTON_PRIMARY;
}
int32_t changed = _mouse_button_state ^ button_state;
if (changed != 0) {
if (changed & AMOTION_EVENT_BUTTON_PRIMARY) {