Struct pnmixerlib::hotkey::Hotkey
[−]
[src]
pub struct Hotkey { pub code: key, pub mod_bits: u32, pub sym: u64, pub gtk_accel: String, }
A hotkey, described by the underlying gdk/X11 representation.
Fields
code: key
The hardware keycode.
mod_bits: u32
The modifier keys and mouse button that have been pressed
in addition to the main key (e.g. Numlock/Capslock).
This is the raw bit representation and can be converted to
gtk::ModifierType
via self.mods()
.
sym: u64
X key symbol.
gtk_accel: String
Gtk Accelerator string.
Methods
impl Hotkey
[src]
fn new(code: key, mods: ModifierType) -> Result<Hotkey>
Creates a new hotkey and grabs it.
fn new_from_accel(accel: &str) -> Result<Hotkey>
Creates a new hotkey from an accelerator string and grabs it.
fn grab(&self) -> Result<()>
Grab a key manually. Should be paired with a ungrab() call.
fn ungrab(&self)
Ungrab a key manually. Should be paired with a grab() call.
fn matches(&self, code: key, mods: ModifierType) -> bool
Checks if the keycode we got (minus modifiers like numlock/capslock) matches the hotkey. Thus numlock + o will match o.