-
Notifications
You must be signed in to change notification settings - Fork 922
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
X11: use sourceid instead of deviceid for input events #3501
base: master
Are you sure you want to change the base?
Conversation
…alues in raw mouse motion handling
I'm not sure you can get access to HID on wayland and open thing yourself, most just ship udev rules, but that's just wrong, there's a protocol in works for things like that, but that's about it. On X11, I guess you pass xid and user needs special access for thing to work as well? |
@@ -1448,15 +1448,15 @@ impl EventProcessor { | |||
|
|||
if mouse_delta != (0.0, 0.0) { |
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.
if mouse_delta != (0.0, 0.0) { | |
if mouse_delta.0.abs() > 0.0001 || mouse_delta.1.abs() > 0.0001 { |
Part of the issue might be that floating point comparisons like this are imprecise. So this should filter out any "garbage" values.
@@ -1448,15 +1448,15 @@ impl EventProcessor { | |||
|
|||
if mouse_delta != (0.0, 0.0) { | |||
let event = Event::DeviceEvent { | |||
device_id: did, | |||
device_id, | |||
event: DeviceEvent::MouseMotion { delta: mouse_delta }, | |||
}; | |||
callback(&self.target, event); | |||
} | |||
|
|||
if scroll_delta != (0.0, 0.0) { |
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.
if scroll_delta != (0.0, 0.0) { | |
if scroll_delta.0.abs() > 0.0001 || scroll_delta.1.abs() > 0.0001 { |
Ditto.
Gilrs is using udev for both Wayland and X11 (and parsing the raw hid reports, like I do on Windows). But theoretically it could easily be done through XI2 https://www.x.org/releases/current/doc/man/man4/joystick.4.xhtml for X11. |
Switched raw mouse input back to using raw_values, as otherwise it would be useless, and #3500 should not occur in games, where its normally used, at least when they don't utilize multiple screens on X11. P.S. after some testing with Bevy, it seems that it doesn't occur at all there |
While trying out gamepad device events for X11, I noticed some issues:
This PRs goal is to address both issues.
CHANGELOG.md
if knowledge of this change could be valuable to users