Crates.io | sysinputs |
lib.rs | sysinputs |
version | 0.0.5 |
source | src |
created_at | 2020-01-23 19:06:17.053565 |
updated_at | 2020-01-23 19:06:17.053565 |
description | Generate native system input events. |
homepage | |
repository | https://github.com/brecert/native-system-input-events |
max_upload_size | |
id | 201325 |
size | 13,579 |
Generate native system input events. Currently windows only.
Contributions welcome!
extern crate sysinputs;
// simple
use sysinputs::keyboard::{send_char, send_str};
// medium
use sysinputs::keyboard::{send_combo, send_key, Key, Physical};
// complicated
use sysinputs::keyboard::{press_key, release_key};
fn main() {
// simple
send_str("echo FOO bar\n");
send_char('\n');
// medium
send_combo(&[
Key::Physical(Physical::E),
Key::Unicode('c'),
Key::Unicode('h'),
Key::Unicode('o'),
]);
send_key(Key::Physical(Physical::Return));
// complicated
press_key(Key::Physical(Physical::Shift));
send_combo(&[
Key::Physical(Physical::E),
Key::Unicode('c'),
Key::Unicode('h'),
Key::Unicode('o'),
]);
release_key(Key::Physical(Physical::Shift));
send_key(Key::Physical(Physical::Return));
}