Set the `MiscCode`s of this device.
(self, misc_set: &AttributeSetRef<MiscCode>)
| 195 | |
| 196 | /// Set the `MiscCode`s of this device. |
| 197 | pub fn with_msc(self, misc_set: &AttributeSetRef<MiscCode>) -> io::Result<Self> { |
| 198 | unsafe { |
| 199 | sys::ui_set_evbit( |
| 200 | self.fd.as_raw_fd(), |
| 201 | crate::EventType::MISC.0 as nix::sys::ioctl::ioctl_param_type, |
| 202 | )?; |
| 203 | } |
| 204 | |
| 205 | for bit in misc_set.iter() { |
| 206 | unsafe { |
| 207 | sys::ui_set_mscbit( |
| 208 | self.fd.as_raw_fd(), |
| 209 | bit.0 as nix::sys::ioctl::ioctl_param_type, |
| 210 | )?; |
| 211 | } |
| 212 | } |
| 213 | |
| 214 | Ok(self) |
| 215 | } |
| 216 | |
| 217 | /// Finalize and register this device. |
| 218 | /// |