pub struct AdjustableDpiFeature { /* private fields */ }Expand description
Adjustable DPI feature implementation.
Implementations§
Source§impl AdjustableDpiFeature
impl AdjustableDpiFeature
Sourcepub fn new(device_index: u8, feature_index: u8) -> Self
pub fn new(device_index: u8, feature_index: u8) -> Self
Creates a new adjustable DPI feature accessor.
§Arguments
device_index- Device index (0xFF for direct)feature_index- Feature index from root feature discovery
Sourcepub async fn get_sensor_count(&self, channel: &HidapiChannel) -> Result<u8>
pub async fn get_sensor_count(&self, channel: &HidapiChannel) -> Result<u8>
Gets the number of sensors on the device.
Most mice have 1 sensor, but some gaming mice have multiple.
§Errors
Returns an error if HID++ communication fails.
Sourcepub async fn get_sensor_dpi_info(
&self,
channel: &HidapiChannel,
sensor_index: u8,
) -> Result<SensorInfo>
pub async fn get_sensor_dpi_info( &self, channel: &HidapiChannel, sensor_index: u8, ) -> Result<SensorInfo>
Sourcepub async fn get_sensor_dpi(
&self,
channel: &HidapiChannel,
sensor_index: u8,
) -> Result<u16>
pub async fn get_sensor_dpi( &self, channel: &HidapiChannel, sensor_index: u8, ) -> Result<u16>
Sourcepub async fn set_sensor_dpi(
&self,
channel: &HidapiChannel,
sensor_index: u8,
dpi: u16,
) -> Result<()>
pub async fn set_sensor_dpi( &self, channel: &HidapiChannel, sensor_index: u8, dpi: u16, ) -> Result<()>
Sourcepub async fn get_default_dpi(
&self,
channel: &HidapiChannel,
sensor_index: u8,
) -> Result<u16>
pub async fn get_default_dpi( &self, channel: &HidapiChannel, sensor_index: u8, ) -> Result<u16>
Source§impl AdjustableDpiFeature
Convenience methods for single-sensor devices.
impl AdjustableDpiFeature
Convenience methods for single-sensor devices.
Sourcepub async fn get_dpi(&self, channel: &HidapiChannel) -> Result<u16>
pub async fn get_dpi(&self, channel: &HidapiChannel) -> Result<u16>
Gets the current DPI for the primary sensor (index 0).
§Errors
Returns an error if HID++ communication fails.
Sourcepub async fn set_dpi(&self, channel: &HidapiChannel, dpi: u16) -> Result<()>
pub async fn set_dpi(&self, channel: &HidapiChannel, dpi: u16) -> Result<()>
Sets the DPI for the primary sensor (index 0).
§Errors
Returns an error if HID++ communication fails or the DPI is out of range.
Sourcepub async fn get_dpi_info(&self, channel: &HidapiChannel) -> Result<SensorInfo>
pub async fn get_dpi_info(&self, channel: &HidapiChannel) -> Result<SensorInfo>
Gets DPI info for the primary sensor (index 0).
§Errors
Returns an error if HID++ communication fails.
Auto Trait Implementations§
impl Freeze for AdjustableDpiFeature
impl RefUnwindSafe for AdjustableDpiFeature
impl Send for AdjustableDpiFeature
impl Sync for AdjustableDpiFeature
impl Unpin for AdjustableDpiFeature
impl UnwindSafe for AdjustableDpiFeature
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