Narsil / rdev

Simple library to listen and send events to keyboard and mouse (MacOS, Windows, Linux)
MIT License
530 stars 132 forks source link

rdev Fails in MacOS Under Remote Control #131

Open lie5860 opened 7 months ago

lie5860 commented 7 months ago

I've been trying to use rdev on a Mac, and I conducted tests using the code below. I found that under default circumstances on macOS, the code works properly. However, if the computer is being remotely accessed through Apple's built-in screen sharing software or similar remote software like todesk, event capturing fails.

use rdev::{listen, Event};
fn callback(event: Event) {
    println!("My callback {:?}", event);
    match event.name {
        Some(string) => println!("User wrote {:?}", string),
        None => (),
    }
}
fn main() {
    // This will block.
    if let Err(error) = listen(callback) {
        println!("Error: {:?}", error)
    }
}
div02-afk commented 3 months ago

If the app crashes on keypress, check this out rdev breaks the app on key press