CKeypad allows your program to gather user input from the up, down, left, right, OK, and cancel buttons.
More...
#include <keypad.h>
List of all members.
Public Member Functions |
| SINGLETON (CKeypad) |
| This internal macro handles instantiation of this class.
|
const unsigned int | GetKey (bool wait=true) |
| Get key input.
|
void | KeyRelease () |
| Wait for key to be released.
|
bool | KeyOk () |
| Return state of OK key.
|
bool | KeyCancel () |
| Return state of Cancel key.
|
bool | KeyUp () |
| Return state of Up key.
|
bool | KeyDown () |
| Return state of Down key.
|
bool | KeyLeft () |
| Return state of Left key.
|
bool | KeyRight () |
| Return state of Right key.
|
Static Public Attributes |
static const unsigned int | KEY_OK = KP_KEY_OK |
static const unsigned int | KEY_CANCEL = KP_KEY_CANCEL |
static const unsigned int | KEY_RIGHT = KP_KEY_RIGHT |
static const unsigned int | KEY_LEFT = KP_KEY_LEFT |
static const unsigned int | KEY_UP = KP_KEY_UP |
static const unsigned int | KEY_DOWN = KP_KEY_DOWN |
Detailed Description
CKeypad allows your program to gather user input from the up, down, left, right, OK, and cancel buttons.
To instantiate this class:
And when done with this class, call Release(), for each call to GetPtr() or GetRef():
Member Function Documentation
const unsigned int CKeypad::GetKey |
( |
bool |
wait = true |
) |
|
Get key input.
- Parameters:
-
| wait | true=wait for key to be pressed before returning, false=do not wait, return immediately with key value, even if no key is being pressed. This method handles switch debouncing. |
- Returns:
- Bitmap of keys being pressed, or 0 if no keys are being pressed. Bitmap values consist of bit values KP_KEY_OK, KP_KEY_CANCEL, KP_KEY_UP, KP_KEY_DOWN, KP_KEY_LEFT, KP_KEY_RIGHT.
bool CKeypad::KeyCancel |
( |
|
) |
[inline] |
Return state of Cancel key.
bool CKeypad::KeyDown |
( |
|
) |
[inline] |
Return state of Down key.
bool CKeypad::KeyLeft |
( |
|
) |
[inline] |
Return state of Left key.
bool CKeypad::KeyOk |
( |
|
) |
[inline] |
void CKeypad::KeyRelease |
( |
|
) |
|
Wait for key to be released.
Returns immediately if no key is being pressed.
bool CKeypad::KeyRight |
( |
|
) |
[inline] |
Return state of Right key.
bool CKeypad::KeyUp |
( |
|
) |
[inline] |
This internal macro handles instantiation of this class.
Note, since this device is input-only (read-only), multiple processes are allowed to use it. In this case, the SINGLETON macro is used to prevent multiple instances within the same process.
Member Data Documentation
The documentation for this class was generated from the following files: