Skip to main content

Capabilities

Struct Capabilities 

Source
pub struct Capabilities {
Show 14 fields pub buttons: bool, pub pointer: bool, pub lighting: bool, pub scroll_inversion: bool, pub hires_wheel: bool, pub thumbwheel: bool, pub haptic_feedback: bool, pub haptic_panel: bool, pub dpi_gestures: bool, pub fn_lock: bool, pub os_layout: bool, pub report_rate: bool, pub backlight: bool, pub easy_switch: bool,
}
Expand description

What a device can be configured to do, derived from the HID++ feature table it reports (feature 0x0001). This is the source of truth for which configuration panels the UI offers — a panel shows iff the device exposes the feature that drives it. Gating on capability rather than on DeviceKind is what keeps a misclassified device from losing its panels (issue #127): kind is an identity guess, capability is what the firmware actually announced.

Fields§

§buttons: bool

Reprogrammable buttons — HID++ 0x1b00–0x1b04 (ReprogControls).

§pointer: bool

Adjustable pointer resolution — HID++ 0x2201 / 0x2202 (AdjustableDpi).

§lighting: bool

Solid-colour RGB the lighting panel can drive — HID++ effect engines (0x8070 / 0x8071) or per-zone lighting (0x8080 / 0x8081). Backlight-only families aren’t driven by the panel, so they don’t earn an inert Lighting tab.

§scroll_inversion: bool

Native vertical wheel inversion — HID++ 0x2121 HiResWheel with the firmware-reported has_invert capability.

§hires_wheel: bool

HID++ 0x2121 HiResWheel is present, so the wheel reporting resolution can be read and changed independently of inversion support.

§thumbwheel: bool

A horizontal thumb wheel is available: either the dedicated HID++ 0x2150 Thumbwheel feature or a legacy 0x6501 Gestures2 descriptor (gesture id 46, used by MX Master 2S).

§haptic_feedback: bool

Programmable haptic feedback — reverse-engineered HID++ 0x19b0.

§haptic_panel: bool

A divertable Haptic Sense Panel control (0x01a0) was found in the device’s 0x1b04 control table.

§dpi_gestures: bool

A DPI/ModeShift control in the device’s 0x1b04 control table supports both diversion and raw-XY reporting for hold-and-swipe gestures.

§fn_lock: bool

Keyboard Fn-lock can be read and written — HID++ 0x40a0, 0x40a2 or 0x40a3 fn inversion. Appended: crosses the IPC and the persisted identity.

§os_layout: bool

The keyboard’s key layout can be kept on the host OS — HID++ 0x4531 MultiPlatform, when the probe also reads that it lets software set the platform. Appended: crosses the IPC and the persisted identity.

§report_rate: bool

The device’s report rate can be chosen — HID++ 0x8060 AdjustableReportRate or 0x8061 ExtendedAdjustableReportRate. Appended: crosses the IPC and the persisted identity.

§backlight: bool

The keyboard’s backlight can be switched and tuned — HID++ 0x1982 Backlight. Appended: crosses the IPC and the persisted identity.

§easy_switch: bool

The device has Easy-Switch host slots whose computers’ names and OS software can read — HID++ 0x1815 HostsInfo. Appended: crosses the IPC and the persisted identity.

Implementations§

Source§

impl Capabilities

Source

pub fn from_feature_ids(ids: &[u16]) -> Self

Derive capabilities from the set of HID++ feature IDs a device reports. Membership of a driving feature ID flips the corresponding flag.

Source

pub fn presumed_from_kind(kind: DeviceKind) -> Self

Best-effort capabilities for a device we could not probe (offline / never reached), guessed from its DeviceKind. Used only as a fallback when no measured Capabilities exist — a sleeping mouse should still show its button/pointer panels so its bindings (host-side) stay configurable.

Trait Implementations§

Source§

impl Clone for Capabilities

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for Capabilities

Source§

impl Debug for Capabilities

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Capabilities

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for Capabilities

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Eq for Capabilities

Source§

impl PartialEq for Capabilities

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for Capabilities

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for Capabilities

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Az for T

Source§

fn az<Dst>(self) -> Dst
where T: Cast<Dst>,

Casts the value.
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<Src, Dst> CastFrom<Src> for Dst
where Src: Cast<Dst>,

Source§

fn cast_from(src: Src) -> Dst

Casts the value.
Source§

impl<T> CheckedAs for T

Source§

fn checked_as<Dst>(self) -> Option<Dst>
where T: CheckedCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> CheckedCastFrom<Src> for Dst
where Src: CheckedCast<Dst>,

Source§

fn checked_cast_from(src: Src) -> Option<Dst>

Casts the value.
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> OverflowingAs for T

Source§

fn overflowing_as<Dst>(self) -> (Dst, bool)
where T: OverflowingCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> OverflowingCastFrom<Src> for Dst
where Src: OverflowingCast<Dst>,

Source§

fn overflowing_cast_from(src: Src) -> (Dst, bool)

Casts the value.
Source§

impl<T> SaturatingAs for T

Source§

fn saturating_as<Dst>(self) -> Dst
where T: SaturatingCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> SaturatingCastFrom<Src> for Dst
where Src: SaturatingCast<Dst>,

Source§

fn saturating_cast_from(src: Src) -> Dst

Casts the value.
Source§

impl<T> StrictAs for T

Source§

fn strict_as<Dst>(self) -> Dst
where T: StrictCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> StrictCastFrom<Src> for Dst
where Src: StrictCast<Dst>,

Source§

fn strict_cast_from(src: Src) -> Dst

Casts the value.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> UnwrappedAs for T

Source§

fn unwrapped_as<Dst>(self) -> Dst
where T: UnwrappedCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> UnwrappedCastFrom<Src> for Dst
where Src: UnwrappedCast<Dst>,

Source§

fn unwrapped_cast_from(src: Src) -> Dst

Casts the value.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> WrappingAs for T

Source§

fn wrapping_as<Dst>(self) -> Dst
where T: WrappingCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> WrappingCastFrom<Src> for Dst
where Src: WrappingCast<Dst>,

Source§

fn wrapping_cast_from(src: Src) -> Dst

Casts the value.