1
0
mirror of git://projects.qi-hardware.com/ben-wpan.git synced 2024-11-22 23:25:54 +02:00

atspi-rssi/gui.c (gui): exit on keystroke or quit request

This commit is contained in:
Werner Almesberger 2010-11-08 20:24:59 -03:00
parent 0463bbea5d
commit e3bae73a5e

View File

@ -112,6 +112,7 @@ void gui(struct atspi_dsc *dsc)
{ {
SDL_Surface *surf; SDL_Surface *surf;
int z[N_CHAN*N_TIME]; int z[N_CHAN*N_TIME];
SDL_Event event;
memset(z, 0, sizeof(z)); memset(z, 0, sizeof(z));
gettimeofday(&t0, NULL); gettimeofday(&t0, NULL);
@ -129,6 +130,11 @@ void gui(struct atspi_dsc *dsc)
} }
while (1) { while (1) {
while (SDL_PollEvent(&event))
if (event.type == SDL_KEYDOWN ||
event.type == SDL_QUIT)
return;
shift_grid(z, N_CHAN, N_TIME); shift_grid(z, N_CHAN, N_TIME);
sweep(dsc, z); sweep(dsc, z);