1 unstable release
Uses old Rust 2015
0.1.0 | Jul 31, 2020 |
---|
#1869 in Hardware support
98 downloads per month
Used in 2 crates
7KB
133 lines
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
Dependencies
~135KB