-
Notifications
You must be signed in to change notification settings - Fork 8
Add relative motion pointer events. #72
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
base: main
Are you sure you want to change the base?
Conversation
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.
Nothing here is generating these events ... so they aren't hooked up to the winit device events.
Also, I suspect that ui-input-state
should get an update to track the relative motion of the primary pointer over the last frame (for its definition of frame).
/// altogether, delivering every frame. | ||
/// | ||
/// This includes the most recent frame. | ||
pub frames: Vec<PointerRelativeFrame>, |
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.
This isn't the same definition of "frame" that we use everywhere ... not sure about this.
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.
I could use the word ‘sample’ instead. It's not exactly a state since it includes a delta along with several state parameters (buttons, click count, etc.)
501bddc
to
e49376c
Compare
e49376c
to
33ee69f
Compare
pub fn reduce_device_event(&mut self, de: &DeviceEvent) -> Option<EventTranslation> { | ||
match de { | ||
DeviceEvent::MouseMotion { delta: (x, y) } => { | ||
const PRIMARY_MOUSE: PointerInfo = PointerInfo { |
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.
Do we know if these only happen for the primary mouse?
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.
While it is technically conceivable on maybe Wayland or X11, this requires very specific configuration, and users expect multi-mouse support to be lacking in applications. We could map the DeviceId
through somehow, but there's no portable way to detect the primary pointer in that case, so we would go from always primary pointer to never primary pointer... and I think one of them is probably more reasonable than the other.
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.
On direct backends, we can be more principled about this. As far as I'm aware macOS only supports one primary virtual pointer. Wayland and X11 applications by default tend only to care about the primary virtual pointer (except for multitouch). On Windows I have no familiarity with multi-mouse, but I think it is handled similarly to macOS in practice (even if it may be easier to distinguish the source device).
This is halted on the lack of ability to normalize relative motion to absolute motion in Winit, so is draft for now. |
No description provided.