Home
Head's Up: I'm in the middle of upgrading my site. Most things are in place, but there are something missing and/or broken including image alt text. Please bear with me while I'm getting things fixed.

Setting Up A Keylogger In Rust

This does mouse and keyboard

This is straight from the home page example :

rust
use device_query::{DeviceEvents, DeviceState};
fn main() {
    let device_state = DeviceState::new();

    let _guard = device_state.on_mouse_move(|position| {
        println!("Mouse position: {:#?}", position);
    });
    let _guard = device_state.on_mouse_down(|button| {
        println!("Mouse button down: {:#?}", button);
    });
    let _guard = device_state.on_mouse_up(|button| {
        println!("Mouse button up: {:#?}", button);
    });
    let _guard = device_state.on_key_down(|key| {
        println!("Keyboard key down: {:#?}", key);
    });
    let _guard = device_state.on_key_up(|key| {
        println!("Keyboard key up: {:#?}", key);
    });

    loop {}
}

Footnotes And References