Function rustwlc::callback::keyboard_key
[−]
[src]
pub fn keyboard_key(
callback: extern "C" fn(_: WlcView, _: u32, _: &KeyboardModifiers, _: u32, _: KeyState) -> bool
)
Callback invoked on keypresses.
Return true
to block the press from the view.
Arguments
The first u32
is a timestamp, the second is the key code. The view may be
the root window.
Proper values for key
can be found in input.h
or a similar library/crate
- see wlc documentation on the subject, it may not support your keyboard
layout at the moment.
Example
use rustwlc::WlcView; use rustwlc::{KeyboardModifiers, KeyState}; extern fn keyboard_key(view: WlcView, time: u32, mods: &KeyboardModifiers, key: u32, state: KeyState) -> bool { println!("Key {} {:?} on {:?} at {} with modifiers {:?}", key, view, state, time, mods); return false; }