370417 / readkey

Find out if a key is currently pressed on macOS.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

readkey

A very small library for finding out if a key is currently pressed on macOS.

Example usage

Check if the Up key is currently pressed:

use readkey::Keycode;

fn main() {
  loop {
    println!("State of Up key: {}", Keycode::Up.is_pressed());
  }
}

Related

readmouse - Read the mouse location on macOS.

About

Find out if a key is currently pressed on macOS.

License:MIT License


Languages

Language:Rust 100.0%