Difference between revisions of "Unit Mouse"
From Ultibo.org
Line 396: | Line 396: | ||
! '''Note''' | ! '''Note''' | ||
| To be documented | | To be documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | |||
+ | '''USB mouse functions''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function USBMouseDeviceRead(Mouse:PMouseDevice; Buffer:Pointer; Size:LongWord; var Count:LongWord):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Implementation of MouseDeviceRead API for USB Mouse</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! '''Note''' | ||
+ | | To be documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function USBMouseDeviceControl(Mouse:PMouseDevice; Request:Integer; Argument1:LongWord; var Argument2:LongWord):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Implementation of MouseDeviceControl API for USB Mouse</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! '''Note''' | ||
+ | | To be documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function USBMouseDriverBind(Device:PUSBDevice; Interrface:PUSBInterface):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Bind the Mouse driver to a USB device if it is suitable</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! '''Device''' | ||
+ | | The USB device to attempt to bind to | ||
+ | |- | ||
+ | ! '''Interface''' | ||
+ | | The USB interface to attempt to bind to (or nil for whole device) | ||
+ | |- | ||
+ | ! '''Return''' | ||
+ | | USB_STATUS_SUCCESS if completed, USB_STATUS_DEVICE_UNSUPPORTED if unsupported or another error code on failure | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function USBMouseDriverUnbind(Device:PUSBDevice; Interrface:PUSBInterface):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Unbind the Mouse driver from a USB device</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! '''Device''' | ||
+ | | The USB device to unbind from | ||
+ | |- | ||
+ | ! '''Interface''' | ||
+ | | The USB interface to unbind from (or nil for whole device) | ||
+ | |- | ||
+ | ! '''Return''' | ||
+ | | USB_STATUS_SUCCESS if completed or another error code on failure | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">procedure USBMouseReportWorker(Request:PUSBRequest);</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Called (by a Worker thread) to process a completed USB request from a USB mouse IN interrupt endpoint</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! '''Request''' | ||
+ | | The USB request which has completed | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">procedure USBMouseReportComplete(Request:PUSBRequest);</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Called when a USB request from a USB mouse IN interrupt endpoint completes</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! '''Request''' | ||
+ | | The USB request which has completed | ||
+ | |- | ||
+ | ! '''Note''' | ||
+ | | Request is passed to worker thread for processing to prevent blocking the USB completion | ||
|- | |- | ||
|} | |} |
Revision as of 04:08, 19 August 2016
Return to Unit Reference
Contents
[hide]Description
Mouse Devices
This unit provides both the Mouse device interface and the generic USB HID mouse driver.
Constants
To be documented
Type definitions
To be documented
Public variables
To be documented
Function declarations
Initialization functions
[Expand]
procedure MouseInit;
Description: Initialize the mouse unit, device table and USB mouse driver
Mouse functions
[Expand]
function MousePeek:LongWord;
Description: Peek at the global mouse buffer to see if any data packets are ready
[Expand]
function MouseRead(Buffer:Pointer; Size:LongWord; var Count:LongWord):LongWord;
Description: Read mouse data packets from the global mouse buffer
[Expand]
function MouseReadEx(Buffer:Pointer; Size,Flags:LongWord; var Count:LongWord):LongWord;
Description: Read mouse data packets from the global mouse buffer
[Expand]
function MouseWrite(Buffer:Pointer; Size,Count:LongWord):LongWord;
Description: Write mouse data packets to the global mouse buffer
[Expand]
function MouseDeviceRead(Mouse:PMouseDevice; Buffer:Pointer; Size:LongWord; var Count:LongWord):LongWord;
Description: Read mouse data packets from the buffer of the specified mouse
[Expand]
function MouseDeviceControl(Mouse:PMouseDevice; Request:Integer; Argument1:LongWord; var Argument2:LongWord):LongWord;
Description: Perform a control request on the specified mouse device
[Expand]
function MouseDeviceSetState(Mouse:PMouseDevice; State:LongWord):LongWord;
Description: Set the state of the specified mouse and send a notification
[Expand]
function MouseDeviceCreateEx(Size:LongWord):PMouseDevice;
Description: Create a new Mouse device entry
[Expand]
function MouseDeviceDestroy(Mouse:PMouseDevice):LongWord;
Description: Destroy an existing Mouse device entry
[Expand]
function MouseDeviceRegister(Mouse:PMouseDevice):LongWord;
Description: Register a new Mouse device in the Mouse table
[Expand]
function MouseDeviceDeregister(Mouse:PMouseDevice):LongWord;
Description: Deregister a Mouse device from the Mouse table
[Expand]
function MouseDeviceFind(MouseId:LongWord):PMouseDevice;
Description: Find a mouse device by ID in the mouse table
[Expand]
function MouseDeviceFindByName(const Name:String):PMouseDevice; inline;
Description: Find a mouse device by name in the mouse table
[Expand]
function MouseDeviceFindByDescription(const Description:String):PMouseDevice; inline;
Description: Find a mouse device by description in the mouse table
[Expand]
function MouseDeviceEnumerate(Callback:TMouseEnumerate; Data:Pointer):LongWord;
Description: Enumerate all mouse devices in the mouse table
[Expand]
function MouseDeviceNotification(Mouse:PMouseDevice; Callback:TMouseNotification; Data:Pointer; Notification,Flags:LongWord):LongWord;
Description: Register a notification for mouse device changes
RTL console functions
[Expand]
function SysConsoleHideMouse(AUserData:Pointer):Boolean;
Description: Handler for Platform ConsoleHideMouse function
[Expand]
function SysConsoleShowMouse(X,Y:LongWord; AUserData:Pointer):Boolean;
Description: Handler for Platform ConsoleShowMouse function
[Expand]
function SysConsoleReadMouse(var X,Y,Buttons:LongWord; AUserData:Pointer):Boolean;
Description: Handler for Platform ConsoleReadMouse function
USB mouse functions
[Expand]
function USBMouseDeviceRead(Mouse:PMouseDevice; Buffer:Pointer; Size:LongWord; var Count:LongWord):LongWord;
Description: Implementation of MouseDeviceRead API for USB Mouse
[Expand]
function USBMouseDeviceControl(Mouse:PMouseDevice; Request:Integer; Argument1:LongWord; var Argument2:LongWord):LongWord;
Description: Implementation of MouseDeviceControl API for USB Mouse
[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
Return to Unit Reference