openloaf-rdev 0.5.1

OpenLoaf fork of rdev — listen and send keyboard / mouse events on Windows, Linux and MacOS. Adds macOS event tap auto re-enable on kCGEventTapDisabledByTimeout / ByUserInput so a temporarily disabled tap doesn't silently drop the next batch of key events.
Documentation
1
2
3
4
5
6
7
use crate::rdev::DisplayError;
use core_graphics::display::CGDisplay;

pub fn display_size() -> Result<(u64, u64), DisplayError> {
    let main = CGDisplay::main();
    Ok((main.pixels_wide(), main.pixels_high()))
}