Unit USBMOUSE

From Ultibo.org
Jump to: navigation, search

Return to Unit Reference


Description


Ultibo USB Mouse Driver unit

USB Mouse Devices

The USB mouse driver in this unit uses HID Boot Protocol only and has been replaced by the HIDMouse unit which provides complete HID Report Protocol support for USB mice. It is retained here for legacy uses and backwards compatibility only.

To use this driver in place of the default HID Mouse driver set the following configuration variables in your application during system initialization.

HID_REGISTER_MOUSE := False;
USB_MOUSE_REGISTER_DRIVER := True;

This driver does not recognize devices that do not report themselves as boot mice, does not correctly recognize the wheel on many devices and is known to be incompatible with the touch pad included in some portable wireless keyboards.

Constants



[Expand]
USB mouse specific constants USBMOUSE_*


[Expand]
USB HID types USB_HID_*


Type definitions



USB HID descriptor

[Expand]

PUSBHIDDescriptor = ^TUSBHIDDescriptor;

TUSBHIDDescriptor = packed record

USB mouse device

[Expand]

PUSBMouseDevice = ^TUSBMouseDevice;

TUSBMouseDevice = record


Public variables


None defined

Function declarations



Initialization functions

[Expand]
procedure USBMouseInit;
Description: Initialize the USB mouse driver


USB mouse functions

[Expand]
function USBMouseDriverBind(Device:PUSBDevice; Interrface:PUSBInterface):LongWord;
Description: Bind the Mouse driver to a USB device if it is suitable


[Expand]
function USBMouseDriverUnbind(Device:PUSBDevice; Interrface:PUSBInterface):LongWord;
Description: Unbind the Mouse driver from a USB device


[Expand]
procedure USBMouseReportWorker(Request:PUSBRequest);
Description: Called (by a Worker thread) to process a completed USB request from a USB mouse IN interrupt endpoint


[Expand]
procedure USBMouseReportComplete(Request:PUSBRequest);
Description: Called when a USB request from a USB mouse IN interrupt endpoint completes


USB mouse helper functions

[Expand]
function USBMouseCheckDevice(Device:PUSBDevice):Boolean;
Description: Check if the supplied USB device is suitable for detection as a HID Mouse Device


[Expand]
function USBMouseDeviceSetProtocol(Mouse:PUSBMouseDevice; Protocol:Byte):LongWord;
Description: Set the report protocol for a USB mouse device


[Expand]
function USBMouseDeviceGetHIDDescriptor(Mouse:PUSBMouseDevice; Descriptor:PUSBHIDDescriptor):LongWord;
Description: Get the HID Descriptor for a USB mouse device


[Expand]
function USBMouseDeviceGetReportDescriptor(Mouse:PUSBMouseDevice; Descriptor:Pointer; Size:LongWord):LongWord;
Description: Get the Report Descriptor for a USB mouse device


Return to Unit Reference