Hi Guys,
I am trying to understand the coding in these project.
https://code.google.com/p/th9x/
https://code.google.com/p/er9x/
At this moment I am particularly interested in understanding the Key input subsystem where navigation keys and Select/Exit keys are scanned in such a way that each botton click can create several events based on how long its been pressed.
As I understand, in a very basic level the code works like this.ISR driven per10ms function calls Key::input() and that function somehow create an event based on how long the keys has been pressed and debouncing is also performed.
so the basic building blocks we can find,
Keys been defined as,
#define INP_B_KEY_LFT 6 #define INP_B_KEY_RGT 5 #define INP_B_KEY_UP 4 #define INP_B_KEY_DWN 3 #define INP_B_KEY_EXT 2 #define INP_B_KEY_MEN 1
and enumuration of Keys can be find as
enum EnumKeys { KEY_MENU , KEY_EXIT , KEY_DOWN , KEY_UP , KEY_RIGHT , KEY_LEFT , }
and some macros related to this
#define EVT_KEY_BREAK(key) ((key)|0x20) #define EVT_KEY_FIRST(key) ((key)|_MSK_KEY_FIRST) #define EVT_KEY_REPT(key) ((key)|_MSK_KEY_REPT) #define EVT_KEY_LONG(key) ((key)|0x80)