Trait InputConvert

Source
pub trait InputConvert {
    // Required methods
    fn affinity(&self, device_type: InputDeviceType) -> Option<i32>;
    fn convert(&self, device_type: InputDeviceType) -> Option<InputDevice>;
}
Expand description

Trait for converting from one input type to another

Required Methods§

Source

fn affinity(&self, device_type: InputDeviceType) -> Option<i32>

Returns how closely this device matches the type of another, for example a standard controller is closely to a NES style controller than a keyboard is. Lower values are closer fits. None = cant be converted at all.

Source

fn convert(&self, device_type: InputDeviceType) -> Option<InputDevice>

Implementors§