#key-code #readkey

readkey

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

10 releases

Uses old Rust 2015

0.2.2 Mar 4, 2025
0.2.1 Dec 29, 2019
0.1.7 Dec 28, 2019
0.1.5 Oct 19, 2018

#25 in macOS and iOS APIs

Download history 409/week @ 2024-12-26 845/week @ 2025-01-02 1079/week @ 2025-01-09 1356/week @ 2025-01-16 911/week @ 2025-01-23 1055/week @ 2025-01-30 1388/week @ 2025-02-06 1389/week @ 2025-02-13 1590/week @ 2025-02-20 1404/week @ 2025-02-27 1536/week @ 2025-03-06 2109/week @ 2025-03-13 1387/week @ 2025-03-20 1284/week @ 2025-03-27 1302/week @ 2025-04-03 1433/week @ 2025-04-10

5,884 downloads per month
Used in 38 crates (3 directly)

MIT license

8KB
163 lines

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.

No runtime deps