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])
| 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 |