Keyboard (KBD) API Functions

Initialization and Termination

KBDSetup Initializes the USB keyboard library.
KBDTeardown Terminates the USB keyboard library.

Callback Notification

KBDDevCallbackF Keyboard attach and detach notifications.
KBDKeyCallbackF Keyboard key event notifications.
KBDLedCallbackF Keyboard LED event notifications.

Synchronous Input

KBDGetKey Returns the key press (or release) stored at the head of the KBD library's internal, low-level key queue. 

Asynchronous Input

KBDSetKeyCallback Registers a function to call when each physical key is pressed or released.

Conversions

KBDTranslateHidCode Given an HID code, modifier state, and country code, returns the KBDUnicode value from the appropriate key map. 

Country Setting

KBDGetCountry Returns the country code for a keyboard channel.
KBDSetCountry Sets the country map to use for a keyboard channel.

Keyboard Status

KBDGetAccessSticky Gets the sticky state of the keyboard (whether modifier keys toggle state or are transient).
KBDSetAccessSticky Sets the sticky state of the keyboard.
KBDGetChannelStatus Gets the status of a keyboard channel as being connected or disconnected.
KBDResetChannel Resets a keyboard to the initial state. Clears all keys.
KBDEmptyQueue Empty characters in keyboard input queue.
KBDGetLockProcessing Gets the status of the lock modifier processing as being enabled or disabled.
KBDSetLockProcessing Sets the lock modifier processing to enabled or disabled.
KBDGetModState Gets the current modifier state.
KBDSetModState Sets the current modifier state.
KBDGetRepeat Gets the current key repeat parameters.
KBDSetRepeat Sets the current key repeat parameters.
KBDSetAttachCallback Registers a function to call when a USB keyboard is attached.
KBDSetDetachCallback Registers a function to call when a USB keyboard is detached.
KBDSetLedsEx Sends a LED command to a keyboard (blocking call).
KBDSetLedsAsyncEx Sends a LED command to a keyboard (non-blocking call).
KBDSetLedsRetryEx Sends a LED command to a keyboard (non-blocking, retrying call).

Structures

KBDDevEvent A structure used by the callback that notifies of a USB keyboard device being physically connected or disconnected.
KBDKeyEvent Structure that stores USB keyboard input and other information.
KBDLedEvent A structure used by the callback of the LED command that is sent to the USB keyboard.
Constants, Enumerators, and Types Other constants, enumerators, and types.

Revision History

2013/11/27 Removed unused anchors.
2013/11/27 Worked anchors.
2013/06/20 Deprecated KBDInitRegion*, KBDInit, KBDExit, KBDSetLeds*. Added KBDSetup, KBDTeardown, KBDSetLeds*Ex. KBD lib sets LEDs per key entry.
2013/05/08 Automated cleanup pass.


CONFIDENTIAL