Set the force-feedback effects that can be emitted by this device.
(self, ff: &AttributeSetRef<FFEffectCode>)
| 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 { |