Difference between revisions of "Unit HIDKEYBOARD"
Line 121: | Line 121: | ||
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | <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 HIDKeyboardDeviceControl(Keyboard:PKeyboardDevice; Request:Integer; Argument1: | + | <pre style="border: 0; padding-bottom:0px;">function HIDKeyboardDeviceControl(Keyboard:PKeyboardDevice; Request:Integer; Argument1:PtrUInt; var Argument2:PtrUInt):LongWord;</pre> |
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Implementation of KeyboardDeviceControl API for HID Keyboard</div> | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Implementation of KeyboardDeviceControl API for HID Keyboard</div> | ||
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> |
Latest revision as of 03:20, 17 November 2022
Return to Unit Reference
Contents
[hide]Description
Ultibo HID Keyboard Consumer unit
This is a consumer for any generic HID keyboard device, it accepts HID application collections in the generic desktop page (HID_PAGE_GENERIC_DESKTOP) with the usage set to keyboard (HID_DESKTOP_KEYBOARD).
The consumer will bind to any keyboard collection that includes at a minimum an input report containing a field that provides keypress data from the keyboard / keypad page (HID_PAGE_KEYBOARD_KEYPAD) and a field providing modifier keys from the same page.
The consumer will also look for an output report containing a field from the LED page (HID_PAGE_LED) and will use this to set the keyboard LEDs if found.
Up to 16 keypresses per report can be accepted (see HID_KEYBOARD_MAX_KEYS) but most keyboards will commonly report up to 6 which is the size defined in the USB HID usage tables for boot mode keyboard reports.
Constants
HID_KEYBOARD_*
Type definitions
HID keyboard keys
PHIDKeyboardKeys = ^THIDKeyboardKeys;
THIDKeyboardKeys = array[0..HID_KEYBOARD_MAX_KEYS - 1] of Byte;
HID keyboard device
Public variables
None defined
Function declarations
Initialization functions
procedure HIDKeyboardInit;
HID keyboard functions
function HIDKeyboardDeviceControl(Keyboard:PKeyboardDevice; Request:Integer; Argument1:PtrUInt; var Argument2:PtrUInt):LongWord;
HID keyboard helper functions
function HIDKeyboardCheckCollection(Collection:PHIDCollection):LongWord;
function HIDKeyboardCheckInputDefinition(Definition:PHIDDefinition):LongWord;
function HIDKeyboardCheckOutputDefinition(Definition:PHIDDefinition):LongWord;
function HIDKeyboardCheckPressed(Keyboard:PHIDKeyboardDevice; ScanCode:Byte):Boolean;
function HIDKeyboardCheckRepeated(Keyboard:PHIDKeyboardDevice; ScanCode:Byte):Boolean;
function HIDKeyboardCheckReleased(Keyboard:PHIDKeyboardDevice; Keys:PHIDKeyboardKeys; ScanCode:Byte):Boolean;
function HIDKeyboardDeviceSetLEDs(Keyboard:PHIDKeyboardDevice; LEDs:Byte):LongWord;
function HIDKeyboardDeviceSetIdle(Keyboard:PHIDKeyboardDevice; Duration,ReportId:Byte):LongWord;
Return to Unit Reference