KBDGetKey

Syntax

#include <revolution/kbd.h>

KBDEc KBDGetKey(KBDChannel ch, KBDKeyEvent *keyEvent);

Arguments

ch Keyboard channel to query.
keyEvent Pointer to the KBDKeyEvent structure. Stores the key event at the head of the KBD library's internal key queue.

Return Values

KBDEc Keyboard error code.
KBD_SUCCESS if the call was successful.
KBD_ERR_NOT_INITIALIZED if the library was not initialized.
KBD_ERR_BAD_VALUE if ch was out of range.
KBD_ERR_BAD_STATUS if the keyboard on channel ch is disconnected.
KBD_ERR_BAD_POINTER if keyEvent is not a valid pointer.

Description

Synchronous API to get key events. Returns key event data from an internal key queue maintained within the KBD library. The key event data are written to the structure pointed to by keyEvent.

If the key HID value is KBD_HID_NONE, no key was pressed since the previous call to this function. If the HID value is KBD_HID_OVERFLOW, the queue has overflowed.

Each keyboard channel has its own key queue.

For more details about the key event structure, refer to KBDKeyEvent.

See Also

Keyboard Functions, KBDSetKeyCallback, KBDKeyEvent

Revision History

2007/03/27 Initial version.


CONFIDENTIAL