hookmap 0.1.0

Register hotkeys and simulate keyboard and mosue input.
docs.rs failed to build hookmap-0.1.0
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Visit the last successful build: hookmap-0.5.1

hookmap

Register hotkeys and simulate keyboard and mosue input.

Supported OS

  • Windows 10

Example

use hookmap::*;

fn main() {
    let hook = Hook::new();

    hook.bind_key(Key::A)
        .on_press(|_| println!("The A key was pressed"));

    let mod_shift = hook.modifier_key(Key::Shift, EventBlock::Unblock);
    mod_shift
        .bind_key(Key::A)
        .on_release(|_| println!("The A key was released while the Shift key was pressed"));

    let mod_shift_ctrl = mod_shift.modifier_key(Key::Ctrl, EventBlock::Unblock);
    mod_shift_ctrl
        .bind_mouse(Mouse::LButton)
        .on_press(|_| println!("The left mouse button was pressed while the Shift key and the Control key were pressed"));

    hook.handle_input();
}