-
Notifications
You must be signed in to change notification settings - Fork 110
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
ndk/event: Implement SourceClass
bitflag
and provide Source::class()
getter
#458
Conversation
485b34e
to
e5b8669
Compare
SourceClass
enum and provide Source::class()
getterSourceClass
bitflag
and provide Source::class()
getter
80b6e1a
to
da5441f
Compare
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.
cool, all looking good to me now!
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.
oh, actually, maybe we shouldn't use !0
but should use AINPUT_SOURCE_CLASS_MASK
?
@rib good point. Since it's |
da5441f
to
250f19b
Compare
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.
Looking good except I think there's a spurious negate for the const _
value for SourceClass
flags.
250f19b
to
c724f6a
Compare
…ss()` getter This `enum` was never `pub` even though it serves a slight purpose to more easily classify various event sources, which is accounted for in the bitmask-like value of `AINPUT_SOURCE_XXX`. Even though every source currently only appears to use a single class value, the class variants all describe an individual bit and should be treated as a bitflags type.
… to be extended Android may return values in `bitflags` that are not yet mapped or recognized in the `ndk` crate. This makes functions like `all()` and `!` behave unexpectedly when they truncate or limit their operation to known bits exclusively. A more likable solution is disabling functions that are susceptible to this, as was done in the `ash` crate.
c724f6a
to
71ee97d
Compare
This
enum
was neverpub
even though it serves a slight purpose to more easily classify various event sources, which is accounted for in the bitmask-like value ofAINPUT_SOURCE_XXX
.