pub struct ReprogControlsFeature { /* private fields */ }Expand description
Reprogrammable Controls feature implementation.
Implementations§
Source§impl ReprogControlsFeature
impl ReprogControlsFeature
Sourcepub fn new(device_index: u8, feature_index: u8) -> Self
pub fn new(device_index: u8, feature_index: u8) -> Self
Creates a new reprogrammable controls feature accessor.
§Arguments
device_index- Device index (0xFF for direct)feature_index- Feature index from root feature discovery
Sourcepub fn feature_index(&self) -> u8
pub fn feature_index(&self) -> u8
Returns the feature index.
Sourcepub async fn get_count(&self, channel: &HidapiChannel) -> Result<u8>
pub async fn get_count(&self, channel: &HidapiChannel) -> Result<u8>
Sourcepub async fn get_control_info(
&self,
channel: &HidapiChannel,
index: u8,
) -> Result<ControlInfo>
pub async fn get_control_info( &self, channel: &HidapiChannel, index: u8, ) -> Result<ControlInfo>
Sourcepub async fn get_all_controls(
&self,
channel: &HidapiChannel,
) -> Result<Vec<ControlInfo>>
pub async fn get_all_controls( &self, channel: &HidapiChannel, ) -> Result<Vec<ControlInfo>>
Gets information about all controls on the device.
§Errors
Returns an error if HID++ communication fails.
Sourcepub async fn get_cid_reporting(
&self,
channel: &HidapiChannel,
cid: u16,
) -> Result<CidReporting>
pub async fn get_cid_reporting( &self, channel: &HidapiChannel, cid: u16, ) -> Result<CidReporting>
Sourcepub async fn set_cid_reporting(
&self,
channel: &HidapiChannel,
reporting: &CidReporting,
) -> Result<()>
pub async fn set_cid_reporting( &self, channel: &HidapiChannel, reporting: &CidReporting, ) -> Result<()>
Parses button events from a HID++ notification.
When buttons are diverted, the device sends HID++ notifications containing button state changes. This function parses such notifications.
§Arguments
data- Raw HID++ report datafeature_index- Expected feature index
§Returns
A vector of button events, or None if this is not a button event notification.
Parses button events from a HID++ notification, tracking state changes.
This version compares against the previous state to generate both press and release events.
§Arguments
data- Raw HID++ report datafeature_index- Expected feature indexprevious_pressed- Set of CIDs that were pressed in the previous state
§Returns
A tuple of (events, new_pressed_set), or None if not a button event.
Auto Trait Implementations§
impl Freeze for ReprogControlsFeature
impl RefUnwindSafe for ReprogControlsFeature
impl Send for ReprogControlsFeature
impl Sync for ReprogControlsFeature
impl Unpin for ReprogControlsFeature
impl UnwindSafe for ReprogControlsFeature
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more