
Former-commit-id: 0cadb77f7d8fd4362beb1bc50caf35d55bf8998f Former-commit-id: 49269e48d57c6839e7cd22c52ffe6e109bf0db82
57 lines
812 B
C
57 lines
812 B
C
#include "input.h"
|
|
#include "view1090.h"
|
|
|
|
void getInput()
|
|
{
|
|
|
|
#ifdef RPI
|
|
if(!digitalRead(27)) {
|
|
exit(0);
|
|
}
|
|
|
|
if(!digitalRead(22)) {
|
|
Modes.mapLogDist = !Modes.mapLogDist;
|
|
}
|
|
|
|
if(!digitalRead(23)) {
|
|
Modes.map = !Modes.map;
|
|
}
|
|
#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;
|
|
|
|
case SDLK_m:
|
|
Modes.map = !Modes.map;
|
|
break;
|
|
|
|
default:
|
|
break;
|
|
}
|
|
break;
|
|
}
|
|
}
|
|
}
|