#include <cafe/kbd.h>

KBDDevCallbackF KBDSetAttachCallback (KBDDevCallbackF fn);


fn Pointer to a function to call back when a USB keyboard device is physically attached.

Return Values

A pointer to the previous keyboard device attach callback.


Registers a function with the USB keyboard library to call whenever a USB keyboard device is connected. The function pointer typedef KBDDevCallbackF is defined as follows.

typedef void (*KBDDevCallbackF) (KBDDevEvent*);

The fn function is called with a pointer to a KBDDevEvent structure that contains the channel (keyboard) that was attached.

Always register the attach callback before calling the KBDInit function. Doing so ensures that the keyboard physically plugged into the console before KBDInit runs is the keyboard that will be attached.

Do Not Call From

Background Do not call this function from the background.

Revision History

2013/05/08 Automated cleanup pass.
2011/12/21 Moved to Cafe.
2007/10/03 Added a note about registering the attach callback.
2007/03/19 Initial version 0.1.