#key-pressed #macos #key-code #finding #up

readkey

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

9 releases

Uses old Rust 2015

0.2.1 Dec 29, 2019
0.1.7 Dec 28, 2019
0.1.5 Oct 19, 2018

#56 in macOS and iOS APIs

Download history 464/week @ 2024-06-11 518/week @ 2024-06-18 489/week @ 2024-06-25 184/week @ 2024-07-02 561/week @ 2024-07-09 632/week @ 2024-07-16 627/week @ 2024-07-23 651/week @ 2024-07-30 617/week @ 2024-08-06 680/week @ 2024-08-13 678/week @ 2024-08-20 873/week @ 2024-08-27 1178/week @ 2024-09-03 975/week @ 2024-09-10 998/week @ 2024-09-17 1330/week @ 2024-09-24

4,614 downloads per month
Used in 36 crates (3 directly)

MIT license

7KB
142 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