#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 952/week @ 2024-12-17 446/week @ 2024-12-24 767/week @ 2024-12-31 908/week @ 2025-01-07 1446/week @ 2025-01-14 1076/week @ 2025-01-21 970/week @ 2025-01-28 1238/week @ 2025-02-04 1511/week @ 2025-02-11 1278/week @ 2025-02-18 1575/week @ 2025-02-25 1344/week @ 2025-03-04 1902/week @ 2025-03-11 1653/week @ 2025-03-18 1495/week @ 2025-03-25 1247/week @ 2025-04-01

6,475 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