Struct rs::submission::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
sourceimpl Submission
impl Submission
pub fn new(vk: ZwpVirtualKeyboardV1, imservice: Option<Box<IMService>>) -> Self
sourcepub fn handle_press(
&mut self,
key_id: KeyStateId,
data: SubmitData<'_>,
keycodes: &Vec<KeyCode>,
time: Timestamp
)
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
pub fn handle_release(&mut self, key_id: KeyStateId, time: Timestamp)
pub fn handle_add_modifier(
&mut self,
key_id: KeyStateId,
modifier: Modifier,
_time: Timestamp
)
pub fn handle_drop_modifier(&mut self, key_id: KeyStateId, _time: Timestamp)
fn update_modifiers(&mut self)
pub fn is_modifier_active(&self, modifier: Modifier) -> bool
pub fn get_active_modifiers(&self) -> HashSet<Modifier>
fn clear_all_modifiers(&mut self)
fn release_all_virtual_keys(&mut self, time: Timestamp)
sourcefn select_keymap(&mut self, idx: usize, time: Timestamp)
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.
pub fn use_layout(&mut self, layout: &LayoutData, time: Timestamp)
Auto Trait Implementations
impl !RefUnwindSafe for Submission
impl !Send for Submission
impl !Sync for Submission
impl Unpin for Submission
impl !UnwindSafe for Submission
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more