pub struct EventWriter<'a> { /* private fields */ }Expand description
Helper for writing a sequence of events to the uinput device.
Returned by UinputDevice::writer.
Implementations§
Source§impl<'a> EventWriter<'a>
impl<'a> EventWriter<'a>
Sourcepub fn write(self, events: &[InputEvent]) -> Result<Self>
pub fn write(self, events: &[InputEvent]) -> Result<Self>
Writes raw events to the device.
Events passed to this method may be buffered to improve performance.
Sourcepub fn slot(self, slot: impl TryInto<Slot>) -> Result<SlotWriter<'a>>
pub fn slot(self, slot: impl TryInto<Slot>) -> Result<SlotWriter<'a>>
Prepares for modification of a multi-touch slot.
This will publish an ABS_MT_SLOT event with the selected slot.
Returns an SlotWriter that can be used to modify slot.
Sourcepub fn set_key_repeat(self, rep: KeyRepeat) -> Result<Self>
pub fn set_key_repeat(self, rep: KeyRepeat) -> Result<Self>
Changes the device’s KeyRepeat configuration.
Requires that Builder::with_key_repeat was called to enable the autorepeat
functionality.
This will write 2 RepeatEvents: one with Repeat::PERIOD and one with
Repeat::DELAY. The uinput system will immediately echo both events back to the
UinputDevice, and to every connected evdev client.
Sourcepub fn finish(self) -> Result<()>
pub fn finish(self) -> Result<()>
Finishes this batch of events by sending a SYN_REPORT event.
If this method isn’t called by the user, it will be called when the EventWriter is
dropped.
Since Drop implementations cannot handle errors, any errors that occur will only be
logged.
It is recommended to use this method instead, to ensure errors are handled correctly.