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

This commit is contained in:
Werner Almesberger
2010-11-08 20:31:38 -03:00
parent 0463bbea5d
commit e3bae73a5e
+6
View File
@@ -112,6 +112,7 @@ void gui(struct atspi_dsc *dsc)
{
SDL_Surface *surf;
int z[N_CHAN*N_TIME];
SDL_Event event;
memset(z, 0, sizeof(z));
gettimeofday(&t0, NULL);
@@ -129,6 +130,11 @@ void gui(struct atspi_dsc *dsc)
}
while (1) {
while (SDL_PollEvent(&event))
if (event.type == SDL_KEYDOWN ||
event.type == SDL_QUIT)
return;
shift_grid(z, N_CHAN, N_TIME);
sweep(dsc, z);