pub struct Input(/* private fields */);Expand description
Refers to the data from one or more similar controls on a device.
For example, variable data such as reading the position of a single axis or a group of levers or array data such as one or more push buttons or switches.
§Data (Little-Endian)
- Bit 0: Data(0) | Constant(1)
- Bit 1: Array(0) | Variable(1)
- Bit 2: Absolute(0) | Relative(1)
- Bit 3: No Wrap(0) | Wrap(1)
- Bit 4: Linear(0) | Non Linear(1)
- Bit 5: Preferred State(0) | No Preferred(1)
- Bit 6: No Null Position(0) | Null State(1)
- Bit 7: Reserved
- Bit 8: Bit Field(0) | Buffered Bytes(1)
- Bit 31-9: Reserved
Implementations§
Source§impl Input
impl Input
Sourcepub const PREFIX: u8 = 0b1000_0000
pub const PREFIX: u8 = 0b1000_0000
Prefix consists of tag(bit 7-4), type(bit 3-2) and size(bit 1-0).
The “size” part is set to 00 in this constant value.
Sourcepub unsafe fn new_unchecked(raw: &[u8]) -> Self
pub unsafe fn new_unchecked(raw: &[u8]) -> Self
Sourcepub fn new_with(data: &[u8]) -> Result<Self, HidError>
pub fn new_with(data: &[u8]) -> Result<Self, HidError>
Create an item with specific data.
NOTE: data size must be: 0, 1, 2 or 4.
Trait Implementations§
impl Eq for Input
impl StructuralPartialEq for Input
Auto Trait Implementations§
impl Freeze for Input
impl RefUnwindSafe for Input
impl Send for Input
impl Sync for Input
impl Unpin for Input
impl UnsafeUnpin for Input
impl UnwindSafe for Input
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