-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
native-activity/input: AND with EVENT_ACTION_MASK
when extracting action
#147
Conversation
EVENT_ACTION_MASK
when extracting action
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed, this was wrongly converted from the NDK. 0xff
is the action, 0xff00
contains the pointer index (which is using the underlying NDK function).
@rib regarding:
android-activity/android-activity/src/native_activity/input.rs
Lines 362 to 364 in 672360c
// XXX: we use `AInputEvent_getAction` directly since we have our own | |
// `KeyAction` enum that we share between backends, which may also | |
// capture unknown variants added in new versions of Android. |
I desperately want to fix this in the NDK as there are new values in r26 that I cannot add without an API break. A few things:
- I want to make these
non_exhaustive
to allow adding new values without API breaks; - The NDK wrongly converts not-yet-handled values to
Unknown
which always has a special_UNKNOWN
variant (with value0
). I.e. the conversion is lossy; - I don't really want to have an
Unknown(i32)
case to provoke updating the NDK instead. I don't know how common it is (for e.g. custom Android distros) to have custom/unknown values;
(One big issue I face now is that there are a bunch of new - and super useful! - functions in Android 14 that are not yet in a released NDK, so I might generate from the latest sysroot as was suggested to me before); - But that requires having a
Result
withTryFromPrimitiveError
; - Hence I do like that you've used the combination of
non_exhaustive
with anUnknown
case that is#[doc(hidden)]
.
After that is done, how do you feel about using the ndk
types again, assuming NativeActivity
and GameActivity
expose the same values? If not, are there any known mismatching / missing values?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the delay with reviewing this.
This looks good to me - thanks!
Pardon me, just passing by, but... why is |
hmm, yeah title should have been updated and then I also copy & pasted that for the changelog, oops. |
EVENT_ACTION_MASK
when extracting actionEVENT_ACTION_MASK
when extracting action
Yeah so the commit title in the repo and changelog will be wrong, but the PR title and GitHub release are fixed to mention @rib side-note: the changelog uses |
yeah I guess we could turn those into links like that. The Keep a Changelog reference that's linked in the changelog does that, so would be nice to be consistent with that.
we can also fly-by fix up the changelog the next time that gets touched. |
Exactly that, yes :) |
Partially fixes #146. Possibly fully fixes the issue as I haven't encountered any issues with multitouch positions with winit on Android.