rs::submission

Struct Submission

Source
pub struct Submission {
    imservice: Option<Box<IMService>>,
    virtual_keyboard: VirtualKeyboard,
    modifiers_active: Vec<(KeyStateId, Modifier)>,
    pressed: Vec<(KeyStateId, SubmittedAction)>,
    keymap_fds: Vec<KeyMap>,
    keymap_idx: Option<usize>,
}

Fields§

§imservice: Option<Box<IMService>>§virtual_keyboard: VirtualKeyboard§modifiers_active: Vec<(KeyStateId, Modifier)>§pressed: Vec<(KeyStateId, SubmittedAction)>§keymap_fds: Vec<KeyMap>§keymap_idx: Option<usize>

Implementations§

Source§

impl Submission

Source

pub fn new(vk: ZwpVirtualKeyboardV1, imservice: Option<Box<IMService>>) -> Self

Source

pub fn handle_press( &mut self, key_id: KeyStateId, data: SubmitData<'_>, keycodes: &Vec<KeyCode>, time: Timestamp, )

Sends a submit text event if possible; otherwise sends key press and makes a note of it

Source

pub fn handle_release(&mut self, key_id: KeyStateId, time: Timestamp)

Source

pub fn handle_add_modifier( &mut self, key_id: KeyStateId, modifier: Modifier, _time: Timestamp, )

Source

pub fn handle_drop_modifier( &mut self, _key_id: KeyStateId, modifier: Modifier, _time: Timestamp, )

Source

fn update_modifiers(&mut self)

Source

pub fn is_modifier_active(&self, modifier: Modifier) -> bool

Source

pub fn get_active_modifiers(&self) -> HashSet<Modifier>

Source

fn clear_all_modifiers(&mut self)

Source

fn release_all_virtual_keys(&mut self, time: Timestamp)

Source

fn select_keymap(&mut self, idx: usize, time: Timestamp)

Changes keymap and clears pressed keys and modifiers.

It’s not obvious if clearing is the right thing to do, but keymap update may (or may not) do that, possibly putting self.modifiers_active and self.pressed out of sync, so a consistent stance is adopted to avoid that. Alternatively, modifiers could be restored on the new keymap. That approach might be difficult due to modifiers meaning different things in different keymaps.

Source

pub fn use_layout(&mut self, layout: &LayoutData, time: Timestamp)

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.