I know how to use events to test when a key is pressed or not, but in C I never found out how to do that.
What I want exactly is a "KeyListener" that listens for the Up, Down, Left and Right arrow keys. I need it to work in Linux, so no Windows libraries. And, if possible, using no 3rd party libraries is the best option for me.
Pseudocode of what I want:
int main() {
// key listener {
// if(key == up) { // do something }
// if(key == down) { // do something }
// if(key == left) { // do something }
// if(key == right) { // do something }
// }
}
How about using SDL to read the keyboard too.
Source: http://www.libsdl.org/docs/html/guideinputkeyboard.html