Struct hid_io_core::module::displayserver::wayland::Keymap[][src]

pub struct Keymap { /* fields omitted */ }

Implementations

impl Keymap[src]

pub fn new(
    virtual_keyboard: Main<ZwpVirtualKeyboardV1>,
    automatic_layout_regen: bool
) -> Keymap
[src]

pub fn generate_keymap_string(&mut self) -> Result<String, DisplayOutputError>[src]

Generates a single-level keymap.

pub fn apply_layout(&mut self, layout: String) -> Result<(), DisplayOutputError>[src]

Apply XKB layout to virtual keyboard The layout is an XKB layout as a string (see generate_keymap_string()) NOTE: This function does not flush any messages to Wayland, you’ll need to schedule afterwards

pub fn lookup_sym(c: char) -> Option<Keysym>[src]

Lookup keysym from a UTF-8 symbol \n and \t are special symbols for Return and Tab respectively

pub fn add(&mut self, chars: Chars<'_>) -> Result<Vec<u32>, DisplayOutputError>[src]

Adds UTF-8 symbols to be added to the virtual keyboard. Returns list of keycodes mapped, 1-to-1 mapping to the given vector for UTF-8 characters If any of the symbols could not be mapped, none of the symbols will mapped. Will increment a reference counter if the symbol has already been added.

Will handle \n (Return) and \t (Tab) as special characters

pub fn remove(&mut self, chars: Chars<'_>) -> Result<(), DisplayOutputError>[src]

Removes UTF-8 symbols from the virtual keyboard. Will decrement a reference counter and will only return zero if that symbols reference counter has reached zero.

pub fn get(&mut self, c: char) -> Option<&Key>[src]

Retrieves the keycode for a given if it exists Use add() if you’re unsure if a keycode hasn’t been mapped to a UTF-8 character yet

pub fn press_key(
    &mut self,
    c: char,
    press: bool
) -> Result<(), DisplayOutputError>
[src]

Press/Release a specific UTF-8 symbol NOTE: This function does not synchronize the event queue, should be done immediately after calling (unless you’re trying to optimize scheduling).

pub fn press_release_key(&mut self, c: char) -> Result<(), DisplayOutputError>[src]

Press then release a specific UTF-8 symbol Faster than individual calls to press_key as you don’t need a delay (or sync) between press and release of the same keycode. NOTE: This function does not synchronize the event queue, should be done immediately after calling (unless you’re trying to optimize scheduling).

Auto Trait Implementations

impl !RefUnwindSafe for Keymap

impl !Send for Keymap

impl !Sync for Keymap

impl Unpin for Keymap

impl !UnwindSafe for Keymap

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T[src]

type Output = T

Should always be Self

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 
[src]