![]() |
Ultibo API
C/C++ API for Ultibo Core
|
Go to the source code of this file.
Data Structures | |
| struct | _MOUSE_DATA |
| struct | _MOUSE_BUFFER |
| struct | _MOUSE_PROPERTIES |
| struct | _MOUSE_DEVICE |
| struct | _USB_HID_DESCRIPTOR |
Macros | |
| #define | MOUSE_NAME_PREFIX "Mouse" |
| Name prefix for Mouse Devices. | |
| #define | MOUSE_TYPE_NONE 0 |
| #define | MOUSE_TYPE_USB 1 |
| #define | MOUSE_TYPE_PS2 2 |
| #define | MOUSE_TYPE_SERIAL 3 |
| #define | MOUSE_TYPE_MAX 3 |
| #define | MOUSE_STATE_DETACHED 0 |
| #define | MOUSE_STATE_DETACHING 1 |
| #define | MOUSE_STATE_ATTACHING 2 |
| #define | MOUSE_STATE_ATTACHED 3 |
| #define | MOUSE_STATE_MAX 3 |
| #define | MOUSE_FLAG_NONE 0x00000000 |
| #define | MOUSE_FLAG_NON_BLOCK 0x00000001 |
| If set device reads are non blocking (Also supported in Flags parameter of MouseReadEx). | |
| #define | MOUSE_FLAG_DIRECT_READ 0x00000002 |
| If set device writes mouse data to its local buffer which must be read using MouseDeviceRead. | |
| #define | MOUSE_FLAG_SWAP_BUTTONS 0x00000004 |
| If set left and right mouse buttons will be swapped in mouse data. | |
| #define | MOUSE_FLAG_PEEK_BUFFER 0x00000008 |
| Peek at the buffer to see if any data is available, don't remove it (Used only in Flags parameter of MouseReadEx). | |
| #define | MOUSE_FLAG_SWAP_XY 0x00000010 |
| If set swap the X and Y coordinates. | |
| #define | MOUSE_FLAG_INVERT_X 0x00000020 |
| If set invert the X coordinate. | |
| #define | MOUSE_FLAG_INVERT_Y 0x00000040 |
| If set invert the Y coordinate. | |
| #define | MOUSE_FLAG_SWAP_MAX_XY 0x00000080 |
| If set swap the maximum X and Y values. | |
| #define | MOUSE_FLAG_MASK MOUSE_FLAG_NON_BLOCK | MOUSE_FLAG_DIRECT_READ | MOUSE_FLAG_SWAP_BUTTONS | MOUSE_FLAG_SWAP_XY | MOUSE_FLAG_INVERT_X | MOUSE_FLAG_INVERT_Y | MOUSE_FLAG_SWAP_MAX_XY |
| #define | MOUSE_CONTROL_GET_FLAG 1 |
| Get Flag. | |
| #define | MOUSE_CONTROL_SET_FLAG 2 |
| Set Flag. | |
| #define | MOUSE_CONTROL_CLEAR_FLAG 3 |
| Clear Flag. | |
| #define | MOUSE_CONTROL_FLUSH_BUFFER 4 |
| Flush Buffer. | |
| #define | MOUSE_CONTROL_GET_SAMPLE_RATE 5 |
| Get Sample Rate. | |
| #define | MOUSE_CONTROL_SET_SAMPLE_RATE 6 |
| Set Sample Rate. | |
| #define | MOUSE_CONTROL_GET_MAX_X 7 |
| Get Maximum X value (Only applies to Absolute X values). | |
| #define | MOUSE_CONTROL_GET_MAX_Y 8 |
| Get Maximum Y value (Only applies to Absolute Y values). | |
| #define | MOUSE_CONTROL_GET_MAX_WHEEL 9 |
| Get Maximum Wheel value (Only applies to Absolute Wheel values). | |
| #define | MOUSE_CONTROL_GET_MAX_BUTTONS 10 |
| Get Maximum Buttons mask (eg MOUSE_LEFT_BUTTON or MOUSE_RIGHT_BUTTON etc). | |
| #define | MOUSE_CONTROL_GET_ROTATION 11 |
| Get Rotation value (0, 90, 180, 270)(Only where supported by the driver). | |
| #define | MOUSE_CONTROL_SET_ROTATION 12 |
| Set Rotation value (0, 90, 180, 270)(Only where supported by the driver). | |
| #define | MOUSE_BUFFER_SIZE 512 |
| #define | MOUSE_SAMPLE_RATE 100 |
| 100 samples/sec | |
| #define | MOUSE_LEFT_BUTTON 0x0001 |
| The Left mouse button is pressed. | |
| #define | MOUSE_RIGHT_BUTTON 0x0002 |
| The Right mouse button is pressed. | |
| #define | MOUSE_MIDDLE_BUTTON 0x0004 |
| The Middle mouse button is pressed. | |
| #define | MOUSE_SIDE_BUTTON 0x0008 |
| The Side mouse button is pressed. | |
| #define | MOUSE_EXTRA_BUTTON 0x0010 |
| The Extra mouse button is pressed. | |
| #define | MOUSE_TOUCH_BUTTON 0x0020 |
| The Touch screen is being touched. | |
| #define | MOUSE_ABSOLUTE_X 0x0040 |
| The OffsetX value is absolute not relative. | |
| #define | MOUSE_ABSOLUTE_Y 0x0080 |
| The OffsetY value is absolute not relative. | |
| #define | MOUSE_ABSOLUTE_WHEEL 0x0100 |
| The OffsetWheel value is absolute not relative. | |
| #define | MOUSE_ROTATION_0 FRAMEBUFFER_ROTATION_0 |
| No rotation. | |
| #define | MOUSE_ROTATION_90 FRAMEBUFFER_ROTATION_90 |
| 90 degree rotation | |
| #define | MOUSE_ROTATION_180 FRAMEBUFFER_ROTATION_180 |
| 180 degree rotation | |
| #define | MOUSE_ROTATION_270 FRAMEBUFFER_ROTATION_270 |
| 270 degree rotation | |
| #define | USB_HID_SUBCLASS_NONE 0 |
| Section 4.2. | |
| #define | USB_HID_SUBCLASS_BOOT 1 |
| Section 4.2. | |
| #define | USB_HID_BOOT_PROTOCOL_NONE 0 |
| Section 4.3. | |
| #define | USB_HID_BOOT_PROTOCOL_KEYBOARD 1 |
| Section 4.3. | |
| #define | USB_HID_BOOT_PROTOCOL_MOUSE 2 |
| Section 4.3. | |
| #define | USB_HID_DESCRIPTOR_TYPE_HID 0x21 |
| Section 7.1. | |
| #define | USB_HID_DESCRIPTOR_TYPE_REPORT 0x22 |
| Section 7.1. | |
| #define | USB_HID_DESCRIPTOR_TYPE_PHYSICAL_DESCRIPTOR 0x23 |
| Section 7.1. | |
| #define | USB_HID_REQUEST_GET_REPORT 0x01 |
| #define | USB_HID_REQUEST_GET_IDLE 0x02 |
| #define | USB_HID_REQUEST_GET_PROTOCOL 0x03 |
| Section 7.2. | |
| #define | USB_HID_REQUEST_SET_REPORT 0x09 |
| #define | USB_HID_REQUEST_SET_IDLE 0x0A |
| #define | USB_HID_REQUEST_SET_PROTOCOL 0x0B |
| Section 7.2. | |
| #define | USB_HID_PROTOCOL_BOOT 0 |
| Section 7.2.5. | |
| #define | USB_HID_PROTOCOL_REPORT 1 |
| Section 7.2.5. | |
| #define | USB_HID_REPORT_INPUT 1 |
| Section 7.2.1. | |
| #define | USB_HID_REPORT_OUTPUT 2 |
| Section 7.2.1. | |
| #define | USB_HID_REPORT_FEATURE 3 |
| Section 7.2.1. | |
| #define | USB_HID_REPORTID_NONE 0 |
| Section 7.2.1. | |
| #define | USB_HID_BOOT_LEFT_BUTTON (1 << 0) |
| #define | USB_HID_BOOT_RIGHT_BUTTON (1 << 1) |
| #define | USB_HID_BOOT_MIDDLE_BUTTON (1 << 2) |
| #define | USB_HID_BOOT_SIDE_BUTTON (1 << 3) |
| #define | USB_HID_BOOT_EXTRA_BUTTON (1 << 4) |
| #define | USB_HID_BOOT_REPORT_SIZE 8 |
| 3 // Appendix B of HID Device Class Definition 1.11 | |
| #define | USB_HID_BOOT_DATA_SIZE 8 |
| Allocate more than the minimum to allow for extra data. | |
Typedefs | |
| typedef struct _MOUSE_DATA | MOUSE_DATA |
| typedef struct _MOUSE_BUFFER | MOUSE_BUFFER |
| typedef struct _MOUSE_PROPERTIES | MOUSE_PROPERTIES |
| typedef struct _MOUSE_DEVICE | MOUSE_DEVICE |
| typedef uint32_t STDCALL(* | mouse_enumerate_cb) (MOUSE_DEVICE *mouse, void *data) |
| typedef uint32_t STDCALL(* | mouse_notification_cb) (DEVICE *device, void *data, uint32_t notification) |
| typedef uint32_t STDCALL(* | mouse_device_read_proc) (MOUSE_DEVICE *mouse, void *buffer, uint32_t size, uint32_t *count) |
| typedef uint32_t STDCALL(* | mouse_device_update_proc) (MOUSE_DEVICE *mouse) |
| typedef uint32_t STDCALL(* | mouse_device_control_proc) (MOUSE_DEVICE *mouse, int request, size_t argument1, size_t *argument2) |
| typedef uint32_t STDCALL(* | mouse_device_get_properties_proc) (MOUSE_DEVICE *mouse, MOUSE_PROPERTIES *properties) |
Functions | |
| uint32_t STDCALL | mouse_peek (void) |
| Peek at the global mouse buffer to see if any data packets are ready. | |
| uint32_t STDCALL | mouse_read (void *buffer, uint32_t size, uint32_t *count) |
| Read mouse data packets from the global mouse buffer. | |
| uint32_t STDCALL | mouse_read_ex (void *buffer, uint32_t size, uint32_t flags, uint32_t *count) |
| Read mouse data packets from the global mouse buffer. | |
| uint32_t STDCALL | mouse_write (void *buffer, uint32_t size, uint32_t count) |
| Write mouse data packets to the global mouse buffer. | |
| uint32_t STDCALL | mouse_flush (void) |
| Flush the contents of the global mouse buffer. | |
| uint32_t STDCALL | mouse_device_read (MOUSE_DEVICE *mouse, void *buffer, uint32_t size, uint32_t *count) |
| Read mouse data packets from the buffer of the specified mouse. | |
| uint32_t STDCALL | mouse_device_update (MOUSE_DEVICE *mouse) |
| Request the specified mouse device to update the current configuration. | |
| uint32_t STDCALL | mouse_device_control (MOUSE_DEVICE *mouse, int request, size_t argument1, size_t *argument2) |
| Perform a control request on the specified mouse device. | |
| uint32_t STDCALL | mouse_device_get_properties (MOUSE_DEVICE *mouse, MOUSE_PROPERTIES *properties) |
| Get the properties for the specified mouse device. | |
| uint32_t STDCALL | mouse_device_set_state (MOUSE_DEVICE *mouse, uint32_t state) |
| Set the state of the specified mouse and send a notification. | |
| MOUSE_DEVICE *STDCALL | mouse_device_create (void) |
| Create a new Mouse device entry. | |
| MOUSE_DEVICE *STDCALL | mouse_device_create_ex (uint32_t size) |
| Create a new Mouse device entry. | |
| uint32_t STDCALL | mouse_device_destroy (MOUSE_DEVICE *mouse) |
| Destroy an existing Mouse device entry. | |
| uint32_t STDCALL | mouse_device_register (MOUSE_DEVICE *mouse) |
| Register a new Mouse device in the Mouse table. | |
| uint32_t STDCALL | mouse_device_deregister (MOUSE_DEVICE *mouse) |
| Deregister a Mouse device from the Mouse table. | |
| MOUSE_DEVICE *STDCALL | mouse_device_find (uint32_t mouseid) |
| Find a mouse device by ID in the mouse table. | |
| MOUSE_DEVICE *STDCALL | mouse_device_find_by_name (const char *name) |
| Find a mouse device by name in the mouse table. | |
| MOUSE_DEVICE *STDCALL | mouse_device_find_by_description (const char *description) |
| Find a mouse device by description in the mouse table. | |
| uint32_t STDCALL | mouse_device_enumerate (mouse_enumerate_cb callback, void *data) |
| Enumerate all mouse devices in the mouse table. | |
| uint32_t STDCALL | mouse_device_notification (MOUSE_DEVICE *mouse, mouse_notification_cb callback, void *data, uint32_t notification, uint32_t flags) |
| Register a notification for mouse device changes. | |
| uint32_t STDCALL | mouse_get_count (void) |
| Get the current mouse count. | |
| MOUSE_DEVICE *STDCALL | mouse_device_check (MOUSE_DEVICE *mouse) |
| Check if the supplied Mouse is in the mouse table. | |
| uint32_t STDCALL | mouse_device_type_to_string (uint32_t mousetype, char *string, uint32_t len) |
| uint32_t STDCALL | mouse_device_state_to_string (uint32_t mousestate, char *string, uint32_t len) |
| uint32_t STDCALL | mouse_device_rotation_to_string (uint32_t rotation, char *string, uint32_t len) |
| Return a string describing the supplied mouse rotation value. | |
| uint32_t STDCALL | mouse_device_state_to_notification (uint32_t state) |
| Convert a Mouse state value into the notification code for device notifications. | |
| uint32_t STDCALL | mouse_device_resolve_rotation (uint32_t rotation) |
| Resolve a value of 0, 90, 180 or 270 to a mouse rotation constant (eg MOUSE_ROTATION_180). | |
| uint32_t STDCALL | mouse_insert_data (MOUSE_DEVICE *mouse, MOUSE_DATA *data, BOOL signal) |
| Insert a TMouseData entry into the mouse buffer (Direct or Global). | |
Variables | |
| struct _USB_HID_DESCRIPTOR | PACKED |
| #define MOUSE_NAME_PREFIX "Mouse" |
Name prefix for Mouse Devices.
Mouse specific constants
| #define MOUSE_TYPE_NONE 0 |
Mouse Device Types
| #define MOUSE_TYPE_USB 1 |
| #define MOUSE_TYPE_PS2 2 |
| #define MOUSE_TYPE_SERIAL 3 |
| #define MOUSE_TYPE_MAX 3 |
| #define MOUSE_STATE_DETACHED 0 |
Mouse Device States
| #define MOUSE_STATE_DETACHING 1 |
| #define MOUSE_STATE_ATTACHING 2 |
| #define MOUSE_STATE_ATTACHED 3 |
| #define MOUSE_STATE_MAX 3 |
| #define MOUSE_FLAG_NONE 0x00000000 |
Mouse Device Flags
| #define MOUSE_FLAG_NON_BLOCK 0x00000001 |
If set device reads are non blocking (Also supported in Flags parameter of MouseReadEx).
| #define MOUSE_FLAG_DIRECT_READ 0x00000002 |
If set device writes mouse data to its local buffer which must be read using MouseDeviceRead.
| #define MOUSE_FLAG_SWAP_BUTTONS 0x00000004 |
If set left and right mouse buttons will be swapped in mouse data.
| #define MOUSE_FLAG_PEEK_BUFFER 0x00000008 |
Peek at the buffer to see if any data is available, don't remove it (Used only in Flags parameter of MouseReadEx).
| #define MOUSE_FLAG_SWAP_XY 0x00000010 |
If set swap the X and Y coordinates.
| #define MOUSE_FLAG_INVERT_X 0x00000020 |
If set invert the X coordinate.
| #define MOUSE_FLAG_INVERT_Y 0x00000040 |
If set invert the Y coordinate.
| #define MOUSE_FLAG_SWAP_MAX_XY 0x00000080 |
If set swap the maximum X and Y values.
| #define MOUSE_FLAG_MASK MOUSE_FLAG_NON_BLOCK | MOUSE_FLAG_DIRECT_READ | MOUSE_FLAG_SWAP_BUTTONS | MOUSE_FLAG_SWAP_XY | MOUSE_FLAG_INVERT_X | MOUSE_FLAG_INVERT_Y | MOUSE_FLAG_SWAP_MAX_XY |
Flags supported by MOUSE_CONTROL_GET/SET/CLEAR_FLAG
| #define MOUSE_CONTROL_GET_FLAG 1 |
Get Flag.
Mouse Device Control Codes
| #define MOUSE_CONTROL_SET_FLAG 2 |
Set Flag.
| #define MOUSE_CONTROL_CLEAR_FLAG 3 |
Clear Flag.
| #define MOUSE_CONTROL_FLUSH_BUFFER 4 |
Flush Buffer.
| #define MOUSE_CONTROL_GET_SAMPLE_RATE 5 |
Get Sample Rate.
| #define MOUSE_CONTROL_SET_SAMPLE_RATE 6 |
Set Sample Rate.
| #define MOUSE_CONTROL_GET_MAX_X 7 |
Get Maximum X value (Only applies to Absolute X values).
| #define MOUSE_CONTROL_GET_MAX_Y 8 |
Get Maximum Y value (Only applies to Absolute Y values).
| #define MOUSE_CONTROL_GET_MAX_WHEEL 9 |
Get Maximum Wheel value (Only applies to Absolute Wheel values).
| #define MOUSE_CONTROL_GET_MAX_BUTTONS 10 |
Get Maximum Buttons mask (eg MOUSE_LEFT_BUTTON or MOUSE_RIGHT_BUTTON etc).
| #define MOUSE_CONTROL_GET_ROTATION 11 |
Get Rotation value (0, 90, 180, 270)(Only where supported by the driver).
| #define MOUSE_CONTROL_SET_ROTATION 12 |
Set Rotation value (0, 90, 180, 270)(Only where supported by the driver).
| #define MOUSE_BUFFER_SIZE 512 |
Mouse Buffer Size
| #define MOUSE_SAMPLE_RATE 100 |
100 samples/sec
Mouse Sampling Rate
| #define MOUSE_LEFT_BUTTON 0x0001 |
The Left mouse button is pressed.
Mouse Data Definitions (Values for TMouseData.Buttons)
| #define MOUSE_RIGHT_BUTTON 0x0002 |
The Right mouse button is pressed.
| #define MOUSE_MIDDLE_BUTTON 0x0004 |
The Middle mouse button is pressed.
| #define MOUSE_SIDE_BUTTON 0x0008 |
The Side mouse button is pressed.
| #define MOUSE_EXTRA_BUTTON 0x0010 |
The Extra mouse button is pressed.
| #define MOUSE_TOUCH_BUTTON 0x0020 |
The Touch screen is being touched.
| #define MOUSE_ABSOLUTE_X 0x0040 |
The OffsetX value is absolute not relative.
| #define MOUSE_ABSOLUTE_Y 0x0080 |
The OffsetY value is absolute not relative.
| #define MOUSE_ABSOLUTE_WHEEL 0x0100 |
The OffsetWheel value is absolute not relative.
| #define MOUSE_ROTATION_0 FRAMEBUFFER_ROTATION_0 |
No rotation.
Mouse Rotation
| #define MOUSE_ROTATION_90 FRAMEBUFFER_ROTATION_90 |
90 degree rotation
| #define MOUSE_ROTATION_180 FRAMEBUFFER_ROTATION_180 |
180 degree rotation
| #define MOUSE_ROTATION_270 FRAMEBUFFER_ROTATION_270 |
270 degree rotation
| #define USB_HID_SUBCLASS_NONE 0 |
Section 4.2.
USB Mouse specific constants Note: The following constants are duplicated with the USBMouse unit for backwards compatibility HID Interface Subclass types (See USB HID v1.11 specification)
| #define USB_HID_SUBCLASS_BOOT 1 |
Section 4.2.
| #define USB_HID_BOOT_PROTOCOL_NONE 0 |
Section 4.3.
HID Interface Protocol types (See USB HID v1.11 specification)
| #define USB_HID_BOOT_PROTOCOL_KEYBOARD 1 |
Section 4.3.
| #define USB_HID_BOOT_PROTOCOL_MOUSE 2 |
Section 4.3.
| #define USB_HID_DESCRIPTOR_TYPE_HID 0x21 |
Section 7.1.
HID Class Descriptor Types (See USB HID v1.11 specification)
| #define USB_HID_DESCRIPTOR_TYPE_REPORT 0x22 |
Section 7.1.
| #define USB_HID_DESCRIPTOR_TYPE_PHYSICAL_DESCRIPTOR 0x23 |
Section 7.1.
| #define USB_HID_REQUEST_GET_REPORT 0x01 |
HID Request types
| #define USB_HID_REQUEST_GET_IDLE 0x02 |
| #define USB_HID_REQUEST_GET_PROTOCOL 0x03 |
Section 7.2.
| #define USB_HID_REQUEST_SET_REPORT 0x09 |
| #define USB_HID_REQUEST_SET_IDLE 0x0A |
| #define USB_HID_REQUEST_SET_PROTOCOL 0x0B |
Section 7.2.
| #define USB_HID_PROTOCOL_BOOT 0 |
Section 7.2.5.
HID Protocol types
| #define USB_HID_PROTOCOL_REPORT 1 |
Section 7.2.5.
| #define USB_HID_REPORT_INPUT 1 |
Section 7.2.1.
HID Report types
| #define USB_HID_REPORT_OUTPUT 2 |
Section 7.2.1.
| #define USB_HID_REPORT_FEATURE 3 |
Section 7.2.1.
| #define USB_HID_REPORTID_NONE 0 |
Section 7.2.1.
HID Report IDs
| #define USB_HID_BOOT_LEFT_BUTTON (1 << 0) |
HID Boot Protocol Button bits
| #define USB_HID_BOOT_RIGHT_BUTTON (1 << 1) |
| #define USB_HID_BOOT_MIDDLE_BUTTON (1 << 2) |
| #define USB_HID_BOOT_SIDE_BUTTON (1 << 3) |
| #define USB_HID_BOOT_EXTRA_BUTTON (1 << 4) |
| #define USB_HID_BOOT_REPORT_SIZE 8 |
3 // Appendix B of HID Device Class Definition 1.11
HID Boot Protocol Report data
| #define USB_HID_BOOT_DATA_SIZE 8 |
Allocate more than the minimum to allow for extra data.
| typedef struct _MOUSE_DATA MOUSE_DATA |
Mouse specific types Mouse Data
| typedef struct _MOUSE_BUFFER MOUSE_BUFFER |
Mouse Buffer
| typedef struct _MOUSE_PROPERTIES MOUSE_PROPERTIES |
Mouse Properties
| typedef struct _MOUSE_DEVICE MOUSE_DEVICE |
Mouse Device
| typedef uint32_t STDCALL(* mouse_enumerate_cb) (MOUSE_DEVICE *mouse, void *data) |
Mouse Enumeration Callback
| typedef uint32_t STDCALL(* mouse_notification_cb) (DEVICE *device, void *data, uint32_t notification) |
Mouse Notification Callback
| typedef uint32_t STDCALL(* mouse_device_read_proc) (MOUSE_DEVICE *mouse, void *buffer, uint32_t size, uint32_t *count) |
Mouse Device Methods
| typedef uint32_t STDCALL(* mouse_device_update_proc) (MOUSE_DEVICE *mouse) |
| typedef uint32_t STDCALL(* mouse_device_control_proc) (MOUSE_DEVICE *mouse, int request, size_t argument1, size_t *argument2) |
| typedef uint32_t STDCALL(* mouse_device_get_properties_proc) (MOUSE_DEVICE *mouse, MOUSE_PROPERTIES *properties) |
| uint32_t STDCALL mouse_peek | ( | void | ) |
Peek at the global mouse buffer to see if any data packets are ready.
Mouse Functions
| uint32_t STDCALL mouse_read | ( | void * | buffer, |
| uint32_t | size, | ||
| uint32_t * | count ) |
Read mouse data packets from the global mouse buffer.
| Buffer | Pointer to a buffer to copy the mouse data packets to |
| Size | The size of the buffer in bytes (Must be at least TMouseData or greater) |
| Count | The number of mouse data packets copied to the buffer |
| uint32_t STDCALL mouse_read_ex | ( | void * | buffer, |
| uint32_t | size, | ||
| uint32_t | flags, | ||
| uint32_t * | count ) |
Read mouse data packets from the global mouse buffer.
| Buffer | Pointer to a buffer to copy the mouse data packets to |
| Size | The size of the buffer in bytes (Must be at least TMouseData or greater) |
| Flags | The flags for the behaviour of the read (eg MOUSE_FLAG_NON_BLOCK) |
| Count | The number of mouse data packets copied to the buffer |
| uint32_t STDCALL mouse_write | ( | void * | buffer, |
| uint32_t | size, | ||
| uint32_t | count ) |
Write mouse data packets to the global mouse buffer.
| Buffer | Pointer to a buffer to copy the mouse data packets from |
| Size | The size of the buffer in bytes (Must be at least TMouseData or greater) |
| Count | The number of mouse data packets to copy from the buffer |
| uint32_t STDCALL mouse_flush | ( | void | ) |
Flush the contents of the global mouse buffer.
| uint32_t STDCALL mouse_device_read | ( | MOUSE_DEVICE * | mouse, |
| void * | buffer, | ||
| uint32_t | size, | ||
| uint32_t * | count ) |
Read mouse data packets from the buffer of the specified mouse.
| Mouse | The mouse device to read from |
| Buffer | Pointer to a buffer to copy the mouse data packets to |
| Size | The size of the buffer in bytes (Must be at least TMouseData or greater) |
| Count | The number of mouse data packets copied to the buffer |
| uint32_t STDCALL mouse_device_update | ( | MOUSE_DEVICE * | mouse | ) |
Request the specified mouse device to update the current configuration.
| Mouse | The mouse device to update |
| uint32_t STDCALL mouse_device_control | ( | MOUSE_DEVICE * | mouse, |
| int | request, | ||
| size_t | argument1, | ||
| size_t * | argument2 ) |
Perform a control request on the specified mouse device.
| Mouse | The mouse device to control |
| Request | The request code for the operation (eg MOUSE_CONTROL_GET_FLAG) |
| Argument1 | The first argument for the operation (Dependent on request code) |
| Argument2 | The second argument for the operation (Dependent on request code) |
| uint32_t STDCALL mouse_device_get_properties | ( | MOUSE_DEVICE * | mouse, |
| MOUSE_PROPERTIES * | properties ) |
Get the properties for the specified mouse device.
| Mouse | The mouse device to get properties from |
| Properties | Pointer to a TMouseProperties structure to fill in |
| uint32_t STDCALL mouse_device_set_state | ( | MOUSE_DEVICE * | mouse, |
| uint32_t | state ) |
Set the state of the specified mouse and send a notification.
| Mouse | The mouse to set the state for |
| State | The new state to set and notify |
| MOUSE_DEVICE *STDCALL mouse_device_create | ( | void | ) |
Create a new Mouse device entry.
| MOUSE_DEVICE *STDCALL mouse_device_create_ex | ( | uint32_t | size | ) |
Create a new Mouse device entry.
| Size | Size in bytes to allocate for new mouse (Including the mouse device entry) |
| uint32_t STDCALL mouse_device_destroy | ( | MOUSE_DEVICE * | mouse | ) |
Destroy an existing Mouse device entry.
| Mouse | The mouse device to destroy |
| uint32_t STDCALL mouse_device_register | ( | MOUSE_DEVICE * | mouse | ) |
Register a new Mouse device in the Mouse table.
| Mouse | The mouse device to register |
| uint32_t STDCALL mouse_device_deregister | ( | MOUSE_DEVICE * | mouse | ) |
Deregister a Mouse device from the Mouse table.
| Mouse | The mouse device to deregister |
| MOUSE_DEVICE *STDCALL mouse_device_find | ( | uint32_t | mouseid | ) |
Find a mouse device by ID in the mouse table.
| MouseId | The ID number of the mouse to find |
| MOUSE_DEVICE *STDCALL mouse_device_find_by_name | ( | const char * | name | ) |
Find a mouse device by name in the mouse table.
| Name | The name of the mouse to find (eg Mouse0) |
| MOUSE_DEVICE *STDCALL mouse_device_find_by_description | ( | const char * | description | ) |
Find a mouse device by description in the mouse table.
| Description | The description of the mouse to find (eg USB HID Mouse) |
| uint32_t STDCALL mouse_device_enumerate | ( | mouse_enumerate_cb | callback, |
| void * | data ) |
Enumerate all mouse devices in the mouse table.
| Callback | The callback function to call for each mouse in the table |
| Data | A private data pointer to pass to callback for each mouse in the table |
| uint32_t STDCALL mouse_device_notification | ( | MOUSE_DEVICE * | mouse, |
| mouse_notification_cb | callback, | ||
| void * | data, | ||
| uint32_t | notification, | ||
| uint32_t | flags ) |
Register a notification for mouse device changes.
| Mouse | The mouse device to notify changes for (Optional, pass nil for all mice) |
| Callback | The function to call when a notification event occurs |
| Data | A private data pointer to pass to callback when a notification event occurs |
| Notification | The events to register for notification of (eg DEVICE_NOTIFICATION_REGISTER) |
| Flags | The flags to control the notification (eg NOTIFIER_FLAG_WORKER) |
| uint32_t STDCALL mouse_get_count | ( | void | ) |
Get the current mouse count.
Mouse Helper Functions
| MOUSE_DEVICE *STDCALL mouse_device_check | ( | MOUSE_DEVICE * | mouse | ) |
Check if the supplied Mouse is in the mouse table.
| uint32_t STDCALL mouse_device_type_to_string | ( | uint32_t | mousetype, |
| char * | string, | ||
| uint32_t | len ) |
| uint32_t STDCALL mouse_device_state_to_string | ( | uint32_t | mousestate, |
| char * | string, | ||
| uint32_t | len ) |
| uint32_t STDCALL mouse_device_rotation_to_string | ( | uint32_t | rotation, |
| char * | string, | ||
| uint32_t | len ) |
Return a string describing the supplied mouse rotation value.
| uint32_t STDCALL mouse_device_state_to_notification | ( | uint32_t | state | ) |
Convert a Mouse state value into the notification code for device notifications.
| uint32_t STDCALL mouse_device_resolve_rotation | ( | uint32_t | rotation | ) |
Resolve a value of 0, 90, 180 or 270 to a mouse rotation constant (eg MOUSE_ROTATION_180).
| uint32_t STDCALL mouse_insert_data | ( | MOUSE_DEVICE * | mouse, |
| MOUSE_DATA * | data, | ||
| BOOL | signal ) |
Insert a TMouseData entry into the mouse buffer (Direct or Global).
| Mouse | The mouse device to insert data for |
| Data | The TMouseData entry to insert |
| Signal | If True then signal that new data is available in the buffer |
| struct _USB_HID_DESCRIPTOR PACKED |