Enum GenericDesktop

Source
#[non_exhaustive]
pub enum GenericDesktop {
Show 115 variants Pointer, Mouse, Joystick, Gamepad, Keyboard, Keypad, MultiaxisController, TabletPCSystemControls, WaterCoolingDevice, ComputerChassisDevice, WirelessRadioControls, PortableDeviceControl, SystemMultiAxisController, SpatialController, AssistiveControl, DeviceDock, DockableDevice, CallStateManagementControl, X, Y, Z, Rx, Ry, Rz, Slider, Dial, Wheel, HatSwitch, CountedBuffer, ByteCount, MotionWakeup, Start, Select, Vx, Vy, Vz, Vbrx, Vbry, Vbrz, Vno, FeatureNotification, ResolutionMultiplier, Qx, Qy, Qz, Qw, SystemControl, SystemPowerDown, SystemSleep, SystemWakeUp, SystemContextMenu, SystemMainMenu, SystemAppMenu, SystemMenuHelp, SystemMenuExit, SystemMenuSelect, SystemMenuRight, SystemMenuLeft, SystemMenuUp, SystemMenuDown, SystemColdRestart, SystemWarmRestart, DpadUp, DpadDown, DpadRight, DpadLeft, IndexTrigger, PalmTrigger, Thumbstick, SystemFunctionShift, SystemFunctionShiftLock, SystemFunctionShiftLockIndicator, SystemDismissNotification, SystemDoNotDisturb, SystemDock, SystemUndock, SystemSetup, SystemBreak, SystemDebuggerBreak, ApplicationBreak, ApplicationDebuggerBreak, SystemSpeakerMute, SystemHibernate, SystemMicrophoneMute, SystemAccessibilityBinding, SystemDisplayInvert, SystemDisplayInternal, SystemDisplayExternal, SystemDisplayBoth, SystemDisplayDual, SystemDisplayToggleIntExtMode, SystemDisplaySwapPrimarySecondary, SystemDisplayToggleLCDAutoscale, SensorZone, RPM, CoolantLevel, CoolantCriticalLevel, CoolantPump, ChassisEnclosure, WirelessRadioButton, WirelessRadioLED, WirelessRadioSliderSwitch, SystemDisplayRotationLockButton, SystemDisplayRotationLockSliderSwitch, ControlEnable, DockableDeviceUniqueID, DockableDeviceVendorID, DockableDevicePrimaryUsagePage, DockableDevicePrimaryUsageID, DockableDeviceDockingState, DockableDeviceDisplayOcclusion, DockableDeviceObjectType, CallActiveLED, CallMuteToggle, CallMuteLED,
}
Expand description

Usage Page 0x1: “Generic Desktop”

This enum is autogenerated from the HID Usage Tables.

let u1 = Usage::GenericDesktop(GenericDesktop::Mouse);
let u2 = Usage::new_from_page_and_id(0x1, 0x2).unwrap();
let u3 = Usage::from(GenericDesktop::Mouse);
let u4: Usage = GenericDesktop::Mouse.into();
assert_eq!(u1, u2);
assert_eq!(u1, u3);
assert_eq!(u1, u4);

assert!(matches!(u1.usage_page(), UsagePage::GenericDesktop));
assert_eq!(0x1, u1.usage_page_value());
assert_eq!(0x2, u1.usage_id_value());
assert_eq!((0x1 << 16) | 0x2, u1.usage_value());
assert_eq!("Mouse", u1.name());

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Pointer

Usage ID 0x1: “Pointer”

§

Mouse

Usage ID 0x2: “Mouse”

§

Joystick

Usage ID 0x4: “Joystick”

§

Gamepad

Usage ID 0x5: “Gamepad”

§

Keyboard

Usage ID 0x6: “Keyboard”

§

Keypad

Usage ID 0x7: “Keypad”

§

MultiaxisController

Usage ID 0x8: “Multi-axis Controller”

§

TabletPCSystemControls

Usage ID 0x9: “Tablet PC System Controls”

§

WaterCoolingDevice

Usage ID 0xA: “Water Cooling Device”

§

ComputerChassisDevice

Usage ID 0xB: “Computer Chassis Device”

§

WirelessRadioControls

Usage ID 0xC: “Wireless Radio Controls”

§

PortableDeviceControl

Usage ID 0xD: “Portable Device Control”

§

SystemMultiAxisController

Usage ID 0xE: “System Multi-Axis Controller”

§

SpatialController

Usage ID 0xF: “Spatial Controller”

§

AssistiveControl

Usage ID 0x10: “Assistive Control”

§

DeviceDock

Usage ID 0x11: “Device Dock”

§

DockableDevice

Usage ID 0x12: “Dockable Device”

§

CallStateManagementControl

Usage ID 0x13: “Call State Management Control”

§

X

Usage ID 0x30: “X”

§

Y

Usage ID 0x31: “Y”

§

Z

Usage ID 0x32: “Z”

§

Rx

Usage ID 0x33: “Rx”

§

Ry

Usage ID 0x34: “Ry”

§

Rz

Usage ID 0x35: “Rz”

§

Slider

Usage ID 0x36: “Slider”

§

Dial

Usage ID 0x37: “Dial”

§

Wheel

Usage ID 0x38: “Wheel”

§

HatSwitch

Usage ID 0x39: “Hat Switch”

§

CountedBuffer

Usage ID 0x3A: “Counted Buffer”

§

ByteCount

Usage ID 0x3B: “Byte Count”

§

MotionWakeup

Usage ID 0x3C: “Motion Wakeup”

§

Start

Usage ID 0x3D: “Start”

§

Select

Usage ID 0x3E: “Select”

§

Vx

Usage ID 0x40: “Vx”

§

Vy

Usage ID 0x41: “Vy”

§

Vz

Usage ID 0x42: “Vz”

§

Vbrx

Usage ID 0x43: “Vbrx”

§

Vbry

Usage ID 0x44: “Vbry”

§

Vbrz

Usage ID 0x45: “Vbrz”

§

Vno

Usage ID 0x46: “Vno”

§

FeatureNotification

Usage ID 0x47: “Feature Notification”

§

ResolutionMultiplier

Usage ID 0x48: “Resolution Multiplier”

§

Qx

Usage ID 0x49: “Qx”

§

Qy

Usage ID 0x4A: “Qy”

§

Qz

Usage ID 0x4B: “Qz”

§

Qw

Usage ID 0x4C: “Qw”

§

SystemControl

Usage ID 0x80: “System Control”

§

SystemPowerDown

Usage ID 0x81: “System Power Down”

§

SystemSleep

Usage ID 0x82: “System Sleep”

§

SystemWakeUp

Usage ID 0x83: “System Wake Up”

§

SystemContextMenu

Usage ID 0x84: “System Context Menu”

§

SystemMainMenu

Usage ID 0x85: “System Main Menu”

§

SystemAppMenu

Usage ID 0x86: “System App Menu”

§

SystemMenuHelp

Usage ID 0x87: “System Menu Help”

§

SystemMenuExit

Usage ID 0x88: “System Menu Exit”

§

SystemMenuSelect

Usage ID 0x89: “System Menu Select”

§

SystemMenuRight

Usage ID 0x8A: “System Menu Right”

§

SystemMenuLeft

Usage ID 0x8B: “System Menu Left”

§

SystemMenuUp

Usage ID 0x8C: “System Menu Up”

§

SystemMenuDown

Usage ID 0x8D: “System Menu Down”

§

SystemColdRestart

Usage ID 0x8E: “System Cold Restart”

§

SystemWarmRestart

Usage ID 0x8F: “System Warm Restart”

§

DpadUp

Usage ID 0x90: “D-pad Up”

§

DpadDown

Usage ID 0x91: “D-pad Down”

§

DpadRight

Usage ID 0x92: “D-pad Right”

§

DpadLeft

Usage ID 0x93: “D-pad Left”

§

IndexTrigger

Usage ID 0x94: “Index Trigger”

§

PalmTrigger

Usage ID 0x95: “Palm Trigger”

§

Thumbstick

Usage ID 0x96: “Thumbstick”

§

SystemFunctionShift

Usage ID 0x97: “System Function Shift”

§

SystemFunctionShiftLock

Usage ID 0x98: “System Function Shift Lock”

§

SystemFunctionShiftLockIndicator

Usage ID 0x99: “System Function Shift Lock Indicator”

§

SystemDismissNotification

Usage ID 0x9A: “System Dismiss Notification”

§

SystemDoNotDisturb

Usage ID 0x9B: “System Do Not Disturb”

§

SystemDock

Usage ID 0xA0: “System Dock”

§

SystemUndock

Usage ID 0xA1: “System Undock”

§

SystemSetup

Usage ID 0xA2: “System Setup”

§

SystemBreak

Usage ID 0xA3: “System Break”

§

SystemDebuggerBreak

Usage ID 0xA4: “System Debugger Break”

§

ApplicationBreak

Usage ID 0xA5: “Application Break”

§

ApplicationDebuggerBreak

Usage ID 0xA6: “Application Debugger Break”

§

SystemSpeakerMute

Usage ID 0xA7: “System Speaker Mute”

§

SystemHibernate

Usage ID 0xA8: “System Hibernate”

§

SystemMicrophoneMute

Usage ID 0xA9: “System Microphone Mute”

§

SystemAccessibilityBinding

Usage ID 0xAA: “System Accessibility Binding”

§

SystemDisplayInvert

Usage ID 0xB0: “System Display Invert”

§

SystemDisplayInternal

Usage ID 0xB1: “System Display Internal”

§

SystemDisplayExternal

Usage ID 0xB2: “System Display External”

§

SystemDisplayBoth

Usage ID 0xB3: “System Display Both”

§

SystemDisplayDual

Usage ID 0xB4: “System Display Dual”

§

SystemDisplayToggleIntExtMode

Usage ID 0xB5: “System Display Toggle Int/Ext Mode”

§

SystemDisplaySwapPrimarySecondary

Usage ID 0xB6: “System Display Swap Primary/Secondary”

§

SystemDisplayToggleLCDAutoscale

Usage ID 0xB7: “System Display Toggle LCD Autoscale”

§

SensorZone

Usage ID 0xC0: “Sensor Zone”

§

RPM

Usage ID 0xC1: “RPM”

§

CoolantLevel

Usage ID 0xC2: “Coolant Level”

§

CoolantCriticalLevel

Usage ID 0xC3: “Coolant Critical Level”

§

CoolantPump

Usage ID 0xC4: “Coolant Pump”

§

ChassisEnclosure

Usage ID 0xC5: “Chassis Enclosure”

§

WirelessRadioButton

Usage ID 0xC6: “Wireless Radio Button”

§

WirelessRadioLED

Usage ID 0xC7: “Wireless Radio LED”

§

WirelessRadioSliderSwitch

Usage ID 0xC8: “Wireless Radio Slider Switch”

§

SystemDisplayRotationLockButton

Usage ID 0xC9: “System Display Rotation Lock Button”

§

SystemDisplayRotationLockSliderSwitch

Usage ID 0xCA: “System Display Rotation Lock Slider Switch”

§

ControlEnable

Usage ID 0xCB: “Control Enable”

§

DockableDeviceUniqueID

Usage ID 0xD0: “Dockable Device Unique ID”

§

DockableDeviceVendorID

Usage ID 0xD1: “Dockable Device Vendor ID”

§

DockableDevicePrimaryUsagePage

Usage ID 0xD2: “Dockable Device Primary Usage Page”

§

DockableDevicePrimaryUsageID

Usage ID 0xD3: “Dockable Device Primary Usage ID”

§

DockableDeviceDockingState

Usage ID 0xD4: “Dockable Device Docking State”

§

DockableDeviceDisplayOcclusion

Usage ID 0xD5: “Dockable Device Display Occlusion”

§

DockableDeviceObjectType

Usage ID 0xD6: “Dockable Device Object Type”

§

CallActiveLED

Usage ID 0xE0: “Call Active LED”

§

CallMuteToggle

Usage ID 0xE1: “Call Mute Toggle”

§

CallMuteLED

Usage ID 0xE2: “Call Mute LED”

Implementations§

Trait Implementations§

Source§

impl AsUsage for GenericDesktop

Source§

fn usage_value(&self) -> u32

Returns the 32 bit Usage value of this Usage

Source§

fn usage_id_value(&self) -> u16

Returns the 16 bit Usage ID value of this Usage

Source§

fn usage(&self) -> Usage

Returns this usage as Usage::GenericDesktop(self) This is a convenience function to avoid having to implement From for every used type in the caller.

let gd_x = GenericDesktop::X;
let usage = Usage::from(GenericDesktop::X);
assert!(matches!(gd_x.usage(), usage));
Source§

impl AsUsagePage for GenericDesktop

Source§

fn usage_page_value(&self) -> u16

Returns the 16 bit value of this UsagePage

This value is 0x1 for GenericDesktop

Source§

fn usage_page(&self) -> UsagePage

Source§

impl BitOr<u16> for GenericDesktop

Source§

fn bitor(self, usage: u16) -> Usage

A convenience function to combine a Usage Page with a value.

This function panics if the Usage ID value results in an unknown Usage. Where error checking is required, use UsagePage::to_usage_from_value.

Source§

type Output = Usage

The resulting type after applying the | operator.
Source§

impl Debug for GenericDesktop

Source§

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

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

impl Display for GenericDesktop

Source§

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

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

impl From<&GenericDesktop> for Usage

Source§

fn from(genericdesktop: &GenericDesktop) -> Usage

Converts to this type from the input type.
Source§

impl From<&GenericDesktop> for UsagePage

Source§

impl From<&GenericDesktop> for u16

Source§

fn from(genericdesktop: &GenericDesktop) -> u16

Converts to this type from the input type.
Source§

impl From<&GenericDesktop> for u32

Source§

fn from(genericdesktop: &GenericDesktop) -> u32

Returns the 32 bit value of this usage. This is identical to GenericDesktop::usage_value().

Source§

impl From<GenericDesktop> for Usage

Source§

fn from(genericdesktop: GenericDesktop) -> Usage

Converts to this type from the input type.
Source§

impl From<GenericDesktop> for UsagePage

Source§

impl From<GenericDesktop> for u16

Source§

fn from(genericdesktop: GenericDesktop) -> u16

Returns the 16bit value of this usage. This is identical to GenericDesktop::usage_page_value().

Source§

impl TryFrom<u16> for GenericDesktop

Source§

type Error = HutError

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

fn try_from(usage_id: u16) -> Result<GenericDesktop, HutError>

Performs the conversion.

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> 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<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

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

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.