Skip to content

Commit 4ffa3ac

Browse files
authored
Merge pull request #147 from ArthurCose/motion-event-mask
native-activity/input: OR with `EVENT_ACTION_MASK` when extracting action
2 parents 967882f + 672360c commit 4ffa3ac

File tree

1 file changed

+2
-1
lines changed
  • android-activity/src/native_activity

1 file changed

+2
-1
lines changed

android-activity/src/native_activity/input.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@ impl<'a> MotionEvent<'a> {
5555
// `MotionAction` enum that we share between backends, which may also
5656
// capture unknown variants added in new versions of Android.
5757
let action =
58-
unsafe { ndk_sys::AMotionEvent_getAction(self.ndk_event.ptr().as_ptr()) as u32 };
58+
unsafe { ndk_sys::AMotionEvent_getAction(self.ndk_event.ptr().as_ptr()) as u32 }
59+
& ndk_sys::AMOTION_EVENT_ACTION_MASK;
5960
action.into()
6061
}
6162

0 commit comments

Comments
 (0)