#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

#29 in macOS and iOS APIs

Download history 800/week @ 2024-12-04 1411/week @ 2024-12-11 923/week @ 2024-12-18 367/week @ 2024-12-25 782/week @ 2025-01-01 888/week @ 2025-01-08 1489/week @ 2025-01-15 1051/week @ 2025-01-22 1037/week @ 2025-01-29 1254/week @ 2025-02-05 1477/week @ 2025-02-12 1335/week @ 2025-02-19 1567/week @ 2025-02-26 1417/week @ 2025-03-05 1984/week @ 2025-03-12 1575/week @ 2025-03-19

6,753 downloads per month
Used in 37 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