KBDInit

Syntax

#include <revolution/kbd.h>
typedef void (*KBDDevCallbackF) (KBDDevEvent *ev);
KBDEc KBDInit (void *kbd_mem, KBDDevCallbackF attach_cb, KBDDevCallbackF detach_cb, KBDKeyCallbackF key_cb);

Arguments

kbd_mem User-allocated memory of KBD_MEM_SIZE for KBD library.
attach_cb Pointer to user-implemented callback function for keyboard attach.
detach_cb Pointer to user-implemented callback function for keyboard detach.
key_cb Pointer to user-implemented callback function for keyboard input.

Return Values

KBDEc Keyboard error code.
If successful, the function returns KBD_SUCCESS.
If the library is already initialized, the function returns KBD_ERR_ALREADY_INITIALIZED.

Description

Initializes the USB keyboard library. The KBD library depends on the HID library, so before calling KBDInit, you should initialize the HID library by calling the HIDOpenAsync function. You must call KBDInit before using the USB keyboard library. Moreover, you need to initialize at least one market (region) after you have called KBDInit.

See Also

Keyboard API Function List

Revision History

2008/09/26 Deleted non-implemented return values. Corrected the explanation to state that this function is called after HIDOpenAsync.
2007/10/08 Added parameters according to the API change.
2007/10/03 Added a note about registering the attach callback.
2007/03/19 Initial version 0.1.



CONFIDENTIAL