Expand description
Raw keyboard hardware events, received independent of what window or widget is focused.
You must enable device events in the app to receive this events.
use zng::prelude::*;
APP.defaults().enable_device_events().run_window(async {
keyboard::raw_device_events::KEY_EVENT.on_pre_event(app_hn!(|args: &keyboard::raw_device_events::KeyArgs, _| {
if args.state == keyboard::KeyState::Pressed {
println!("key pressed {:?}", args.key_code);
}
})).perm();
Window!()
});
Structs§
- Arguments for the
KEY_EVENT
. - Arguments for the
TEXT_EVENT
.
Statics§
- Keyboard device key press.
- Raw text input.