Gorgon
Show / Hide Table of Contents

Class GorgonRawHID

Provides state for human interface data returned from Raw Input.

Inheritance
object
GorgonRawHID
Implements
IGorgonRawHID
IGorgonRawInputDevice
IGorgonRawInputDeviceData<GorgonRawHIDData>
IDisposable
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: Gorgon.Input
Assembly: Gorgon.Input.dll
Syntax
public class GorgonRawHID : IGorgonRawHID, IGorgonRawInputDevice, IGorgonRawInputDeviceData<GorgonRawHIDData>, IDisposable
Remarks

This allows a user to read, and parse human interface device data from an aribtrary device. It is recommended that this object be wrapped by an actual object that will be used to present the data in an easy to manipulate format.

This object implements IDisposable because it manipulates native memory. It is necessary to call the Dispose() method in order to ensure there is no memory leak when finished with this object.

Constructors

| Edit this page View Source

GorgonRawHID(GorgonRawHIDInfo)

Initializes a new instance of the GorgonRawHID class.

Declaration
public GorgonRawHID(GorgonRawHIDInfo hidInfo)
Parameters
Type Name Description
GorgonRawHIDInfo hidInfo

The human interface device information used to determine which keyboard to use.

Exceptions
Type Condition
ArgumentNullException

Thrown when the hidInfo is null.

Properties

| Edit this page View Source

Count

Property to return the number of inputs in the Data.

Declaration
public int Count { get; }
Property Value
Type Description
int
| Edit this page View Source

Data

Property to return a pointer to the block of memory that stores the HID data.

Declaration
public GorgonPtr<byte> Data { get; }
Property Value
Type Description
GorgonPtr<byte>
| Edit this page View Source

DeviceType

Property to return the type of device.

Declaration
public RawInputType DeviceType { get; }
Property Value
Type Description
RawInputType
| Edit this page View Source

HIDSize

Property to return the size of an individual HID input, in bytes.

Declaration
public int HIDSize { get; }
Property Value
Type Description
int
| Edit this page View Source

Handle

Property to return the handle for the device.

Declaration
public nint Handle { get; }
Property Value
Type Description
nint
| Edit this page View Source

Info

Property to return information about the Raw Input Human Interface Device.

Declaration
public IGorgonRawHIDInfo Info { get; }
Property Value
Type Description
IGorgonRawHIDInfo
| Edit this page View Source

PreParsedData

Property to return the pre-parsed data for this HID.

Declaration
public GorgonPtr<byte> PreParsedData { get; }
Property Value
Type Description
GorgonPtr<byte>

Methods

| Edit this page View Source

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

Declaration
public void Dispose()

Events

| Edit this page View Source

DataReceived

Event triggered when Raw Input receives data from the device.

Declaration
public event EventHandler<GorgonHIDEventArgs> DataReceived
Event Type
Type Description
EventHandler<GorgonHIDEventArgs>

Implements

IGorgonRawHID
IGorgonRawInputDevice
IGorgonRawInputDeviceData<T>
IDisposable

Extension Methods

GorgonDebugExtensions.ValidateObject<T>(T, string)
GorgonNullExtensions.AsNullable<T>(object)
GorgonNullExtensions.IfNull<T>(object, T)
GorgonNullExtensions.IsNull(object)
  • Edit this page
  • View Source
In this article
Back to top Copyright 2023 - Licensed under the MIT license by Michael Winsor (Tape_Worm).
Send comments on this topic to the author