#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

#60 in macOS and iOS APIs

Download history 537/week @ 2024-01-03 396/week @ 2024-01-10 452/week @ 2024-01-17 505/week @ 2024-01-24 431/week @ 2024-01-31 514/week @ 2024-02-07 448/week @ 2024-02-14 435/week @ 2024-02-21 527/week @ 2024-02-28 540/week @ 2024-03-06 479/week @ 2024-03-13 620/week @ 2024-03-20 522/week @ 2024-03-27 533/week @ 2024-04-03 588/week @ 2024-04-10 495/week @ 2024-04-17

2,222 downloads per month
Used in 34 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