#include <KeyPad.hpp>
Collaboration diagram for KeyPad:

Public Member Functions | |
| KeyPad (int repeat_delay, int repeat_rate) | |
| KeyPad constructor. | |
| uint16 | Update (int buttons=-1, int x=-1, int y=-1, int z1=-1, int z2=-1) |
| Update the current keypresses. | |
| uint16 | GetKeys (void) |
| Get the "unadulterated" current keypresses. | |
| bool | TouchPos (uint16 &x, uint16 &y) |
| If the touchscreen has been pressed, returns the calculated touch position. | |
Static Public Member Functions | |
| bool | TouchPos (int buttons, int x, int y, int z1, int z2, uint16 &x, uint16 &y) |
| Mechanism to convert the raw coordinates into calculated coordinates. Static member so that the KeyPad object is not required. | |
Protected Member Functions | |
| bool | updateKey (uint16 keys, uint16 counter, keyData &key) |
| Using the keys that are currently read and the current key state, determine if a keypress should be reported. | |
Private Attributes | |
| uint16 | repeat_delay |
| Counter ticks before reporting first repated key. | |
| uint16 | repeat_rate |
| Counter ticks between reporting repeated keypress. | |
| uint16 | counter |
| The number of times Update has been called. | |
| uint16 | current_keys |
| The results of the most recent READ_KEYS query. | |
| keyData | kd [KP_NUM_KEYS] |
| Data for each key. | |
| uint16 | touchX |
| The current raw touch X position. | |
| uint16 | touchY |
| The current raw touch Y position. | |
| uint16 | touchZ1 |
| The current x-panel measurements. | |
| uint16 | touchZ2 |
| The current x-panel measurements. | |
| uint16 | buttons |
| X, Y, /PENIRQ buttons. | |
Typical usage is to call Update on each VBlank interrupt, providing approximately 60 calls per second. This can be used to calculate an appropriate repeat_delay and repeat_rate. For example, values of 30, 10 would cause half a second to pass before repeating the keypress. It would then be reported as pressed every 1/6th of a second thereafter.
|
||||||||||||
|
KeyPad constructor.
|
|
||||||||||||||||
|
Using the keys that are currently read and the current key state, determine if a keypress should be reported.
|
|
||||||||||||||||||||||||
|
Update the current keypresses.
|
|
||||||||||||
|
If the touchscreen has been pressed, returns the calculated touch position.
|
|
||||||||||||||||||||||||||||||||
|
Mechanism to convert the raw coordinates into calculated coordinates. Static member so that the KeyPad object is not required.
|
1.3.6