MCPcopy Create free account
hub / github.com/emberian/evdev / emit

Method emit

src/uinput.rs:318–322  ·  view source on GitHub ↗

Post a batch of events to the virtual device. The batch is automatically terminated with a `SYN_REPORT` event. Events from physical devices are batched based on if they occur simultaneously, for example movement of a mouse triggers a movement events for the X and Y axes separately in a batch of 2 events. Single events such as a `KEY` event must still be followed by a `SYN_REPORT`.

(&mut self, events: &[InputEvent])

Source from the content-addressed store, hash-verified

316 ///
317 /// Single events such as a `KEY` event must still be followed by a `SYN_REPORT`.
318 pub fn emit(&mut self, events: &[InputEvent]) -> io::Result<()> {
319 self.write_raw(events)?;
320 let syn = *SynchronizationEvent::new(crate::SynchronizationCode::SYN_REPORT, 0);
321 self.write_raw(&[syn])
322 }
323
324 /// Processes the given [`UInputEvent`] if it is a force feedback upload event, in which case
325 /// this function will start the force feedback upload and claim ownership over the

Callers 8

test_get_key_stateFunction · 0.80
test_compensate_keysFunction · 0.80
mainFunction · 0.80
mainFunction · 0.80
mainFunction · 0.80

Calls 1

write_rawMethod · 0.80

Tested by 5

test_get_key_stateFunction · 0.64
test_compensate_keysFunction · 0.64