pub trait Enable {
// Required methods
fn enable<D: DeviceWrapper>(&self, device: &D) -> Result<()>;
fn disable<D: DeviceWrapper>(&self, device: &D) -> Result<()>;
fn has<D: DeviceWrapper>(&self, device: &D) -> bool;
}
Expand description
Types that can be enabled on a DeviceWrapper (i.e. buttons, keys, relative motion)
Generally this method will not be called directly, but will insted be called through Device::enable()
let dev = UninitDevice::new().expect("Device creation failed");
dev.enable(EventCode::EV_REL(REL_X)).expect("Enable failed");
If you need to enable a EV_ABS or EV_REP event code, use enable_event_code, as this implementation doesn’t pass EV_ABS data.
Required Methods§
fn enable<D: DeviceWrapper>(&self, device: &D) -> Result<()>
fn disable<D: DeviceWrapper>(&self, device: &D) -> Result<()>
fn has<D: DeviceWrapper>(&self, device: &D) -> bool
Object Safety§
This trait is not object safe.