marmakoide
Still Fresh
Hi all !
I'am just beginning to get into the GP2X development, learning by making tiny demos. I want to bypass the SDL, to get a full freedom and speed (and also pain ). My actual main problem is to get the events from the keys and the joystick.
what I do now
Direct read of the keys state, as I seen it in a Squidge tutorial on GP2X demo programming
The bad thing with this, is I get the state of key at a given moment in my program execution, so I could miss many events, or information such how many time since the last key event.
what I wish to do
Using an interrupt to get the keys (and joystick if possible) events : pressed key released. This way, I miss no event and I could compute the time between keys event. But well, how to do it, and do it well ?
1) The direct way : using a key interrupt, if any ?
2) The indirect way : using a timer interrupt, if any ? Then, at each interrupt I will check all the keys state.
I'am just beginning to get into the GP2X development, learning by making tiny demos. I want to bypass the SDL, to get a full freedom and speed (and also pain ). My actual main problem is to get the events from the keys and the joystick.
what I do now
Direct read of the keys state, as I seen it in a Squidge tutorial on GP2X demo programming
Code:
int isStartButtonPushed() {
if (mmsp2_regs_16[0x1184 >> 1] & 0x100)
return 0;
return 1;
}
what I wish to do
Using an interrupt to get the keys (and joystick if possible) events : pressed key released. This way, I miss no event and I could compute the time between keys event. But well, how to do it, and do it well ?
1) The direct way : using a key interrupt, if any ?
2) The indirect way : using a timer interrupt, if any ? Then, at each interrupt I will check all the keys state.