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

Method process_event

src/device_state.rs:109–127  ·  view source on GitHub ↗
(&mut self, ev: InputEvent)

Source from the content-addressed store, hash-verified

107
108 #[inline]
109 pub(crate) fn process_event(&mut self, ev: InputEvent) {
110 match ev.destructure() {
111 EventSummary::Key(_, code, _) => {
112 let keys = self
113 .key_vals
114 .as_deref_mut()
115 .expect("got a key event despite not supporting keys");
116 keys.set(code, ev.value() != 0);
117 }
118 EventSummary::AbsoluteAxis(_, axis, _) => {
119 let axes = self
120 .abs_vals
121 .as_deref_mut()
122 .expect("got an abs event despite not supporting absolute axes");
123 axes[axis.0 as usize].value = ev.value();
124 }
125 _ => {}
126 }
127 }
128}

Callers 2

nextMethod · 0.80
poll_eventMethod · 0.80

Calls 3

setMethod · 0.80
valueMethod · 0.80
destructureMethod · 0.45

Tested by

no test coverage detected