Skip to content
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

MouseMove events don't get discarded on MacOS #135

Open
dtitov opened this issue Jun 21, 2024 · 0 comments
Open

MouseMove events don't get discarded on MacOS #135

dtitov opened this issue Jun 21, 2024 · 0 comments

Comments

@dtitov
Copy link

dtitov commented Jun 21, 2024

I've tried running grab example on MacOS Sonoma - and it works, the tab KeyPress gets discarded. However, when I tried to achieve the same behavior for MouseMove events, it didn't work:

use rdev::{grab, Event};
use rdev::EventType::MouseMove;

fn main() {
    if let Err(error) = grab(callback) {
        println!("Error: {:?}", error)
    }
}

fn callback(event: Event) -> Option<Event> {
    match event.event_type {
        MouseMove { x, y } => {
            println!("Mouse moved: [{x}, {y}]");
            None
        }
        _ => Some(event),
    }
}

Is it not possible to discard MouseMove the same way as we can discard KeyPress events?

@dtitov dtitov changed the title Mouse move events don't get discarded on MacOS MouseMove events don't get discarded on MacOS Jun 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant