Add relative motion pointer events. - #72
Conversation
waywardmonkeys
left a comment
There was a problem hiding this comment.
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.
This isn't the same definition of "frame" that we use everywhere ... not sure about this.
There was a problem hiding this comment.
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.
Do we know if these only happen for the primary mouse?
There was a problem hiding this comment.
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.
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.