
Former-commit-id: 5ccce0dd66b202b6e0178cc3cff2e4f9a70b736f Former-commit-id: 3616fa85a3b74c0acc493e50224746adc8cf3c31
45 lines
642 B
C
45 lines
642 B
C
#include "input.h"
|
|
#include "view1090.h"
|
|
|
|
void getInput()
|
|
{
|
|
|
|
#ifdef RPI
|
|
if(!digitalRead(23) || !digitalRead(22)) {
|
|
exit(0);
|
|
}
|
|
#endif
|
|
|
|
SDL_Event event;
|
|
|
|
/* Loop through waiting messages and process them */
|
|
|
|
while (SDL_PollEvent(&event))
|
|
{
|
|
switch (event.type)
|
|
{
|
|
/* Closing the Window or pressing Escape will exit the program */
|
|
|
|
case SDL_QUIT:
|
|
exit(0);
|
|
break;
|
|
|
|
case SDL_KEYDOWN:
|
|
switch (event.key.keysym.sym)
|
|
{
|
|
case SDLK_ESCAPE:
|
|
exit(0);
|
|
break;
|
|
|
|
case SDLK_l:
|
|
Modes.mapLogDist = !Modes.mapLogDist;
|
|
break;
|
|
|
|
default:
|
|
break;
|
|
}
|
|
break;
|
|
}
|
|
}
|
|
}
|