Go to the source code of this file.
| static bool GetKeyState |
( |
void |
| ) |
|
|
inlinestatic |
| static void KeyInt |
( |
void |
| ) |
|
|
inlinestatic |
Must be called from the 100Hz-Timer Interrupt.
kflags are set in the following order:
KEY_PRESSED as soon as a key press is detected
KEY_PRESSEDSHORT the key has been released but has not been pressed for at least 2.5 seconds
KEY_PRESSEDLONG the Key is pressed for 2.5 seconds or more (but not necessarily released yet).
Only the KEY_PRESSED event is immediate. The others are set after the key has been released or after 2.5 seconds.
The times have a granularity of 100ms (i.e. KEY_PRESSED may be detected 99ms after the key has really been pressed and the 2.5 seconds may have been 2.50 or 2.599 seconds) but that's absolutely o.k. for a UI.
| const uint8_t KFLAG_KEYPRESSED =1 |
|
static |
The key has been pressed.
| const uint8_t KFLAG_KEYPRESSEDLONG =8 |
|
static |
The key has been pressed for more than 2 seconds.
| const uint8_t KFLAG_KEYPRESSEDSHORT =4 |
|
static |
The key has been pressed and released within 2 seconds.
| const uint8_t KFLAG_KEYRELEASED =2 |
|
static |
The key has been released.
Flags set by KeyInt() for evaluation by the main loop.