Skip to content

YXL76/keyboard_query

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

64 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

keyboard_query

A simple library to query keyboard inputs on demand without a window. Will work in Windows, Linux on X11, and macOS.

Example

extern crate keyboard_query;

use keyboard_query::{DeviceQuery, DeviceState};

fn main() {
    let device_state = DeviceState::new();
    let mut prev_keys = vec![];
    loop {
        let keys = device_state.get_keys();
        if keys != prev_keys {
            println!("{:?}", keys);
        }
        prev_keys = keys;
    }
}

Dependencies

On Ubuntu/Debian:

sudo apt install libx11-dev

On Fedora/RHEL/CentOS:

sudo dnf install xorg-x11-server-devel

About

A simple library to query mouse and keyboard inputs without a window. Will work in Windows, Linux, and macOS.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Rust 100.0%