KBDSetAttachCallback

Syntax

#include <revolution/kbd.h>
KBDDevCallbackF KBDSetAttachCallback (KBDDevCallbackF fn);

Arguments

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

Return Values

KBDDevCallbackF A pointer to the previous keyboard device attach callback.

Description

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 struct _KBDDevEvent {
  KBDChannel channel;
} KBDDevEvent;

typedef void (*KBDDevCallbackF) (KBDDevEvent*);

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

You must always register the attach callback before calling the KBDInit function. Doing so ensures that the keyboard physically plugged into the console before KBDInit executes is the keyboard that will be attached.

See Also

Keyboard API Function List

Revision History

2007/10/03 Added a note about registering the attach callback.
2007/03/19 Initial version 0.1.



CONFIDENTIAL