Expand description
keytap — cross-platform, observe-only global keyboard taps.
See DESIGN.md in the repository root for the full architecture.
use keytap::{Tap, EventKind, Key};
let tap = Tap::new()?;
for event in tap.iter() {
if let EventKind::KeyDown(Key::MetaRight) = event.kind {
println!("Right-⌘ pressed");
}
}Modules§
- chord
- Chord matching on top of a raw
crate::Tap.
Structs§
- Event
- A keyboard event observed by a
Tap. - RawCode
- A raw, platform-specific scancode. On macOS this is a
kVK_*virtual keycode; on Windows a virtual-key code; on Linux an evdevKEY_*code. - Recv
Error - An error returned from the
recvmethod. - Tap
- A live global keyboard tap. Drop it to stop listening.
- TapBuilder
- Configurable
Tapconstruction. - TapIter
- Iterator over a
Tap. Blocks on eachnext(). Ends when the tap is dropped.
Enums§
- Error
- Errors returned when creating a
Tapor during its lifetime. - Event
Kind - Event variants.
- Key
- A physical key identity, layout-independent.
- Recv
Timeout Error - An error returned from the
recv_timeoutmethod. - TryRecv
Error - An error returned from the
try_recvmethod.