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

Method with_ff

src/uinput.rs:170–188  ·  view source on GitHub ↗

Set the force-feedback effects that can be emitted by this device.

(self, ff: &AttributeSetRef<FFEffectCode>)

Source from the content-addressed store, hash-verified

168
169 /// Set the force-feedback effects that can be emitted by this device.
170 pub fn with_ff(self, ff: &AttributeSetRef<FFEffectCode>) -> io::Result<Self> {
171 unsafe {
172 sys::ui_set_evbit(
173 self.fd.as_raw_fd(),
174 crate::EventType::FORCEFEEDBACK.0 as nix::sys::ioctl::ioctl_param_type,
175 )?;
176 }
177
178 for bit in ff.iter() {
179 unsafe {
180 sys::ui_set_ffbit(
181 self.fd.as_raw_fd(),
182 bit.0 as nix::sys::ioctl::ioctl_param_type,
183 )?;
184 }
185 }
186
187 Ok(self)
188 }
189
190 /// Set the maximum number for a force-feedback effect for this device.
191 pub fn with_ff_effects_max(mut self, ff_effects_max: u32) -> Self {

Callers 1

mainFunction · 0.80

Calls 2

iterMethod · 0.80
as_raw_fdMethod · 0.45

Tested by

no test coverage detected