commit 6c646788292d891c6a60e01d9a707127570ef282
parent c4d9e52fd61ab340f8875cfa26dc14abc4e1a9ba
Author: neauoire <aliceffekt@gmail.com>
Date: Sun, 19 Dec 2021 12:20:21 -0800
Merge branch 'main' of git.sr.ht:~rabbits/uxn
Diffstat:
1 file changed, 6 insertions(+), 0 deletions(-)
diff --git a/src/uxnemu.c b/src/uxnemu.c
@@ -526,6 +526,7 @@ run(Uxn *u)
while(!devsystem->dat[0xf]) {
SDL_Event event;
double elapsed, begin = 0;
+ int ksym;
if(!BENCH)
begin = SDL_GetPerformanceCounter();
while(SDL_PollEvent(&event) != 0) {
@@ -544,6 +545,10 @@ run(Uxn *u)
doctrl(u, &event, event.type == SDL_KEYDOWN);
uxn_eval(u, devctrl->vector);
devctrl->dat[3] = 0;
+
+ ksym = event.key.keysym.sym;
+ if(SDL_PeepEvents(&event, 1, SDL_PEEKEVENT, SDL_KEYUP, SDL_KEYUP) == 1 && ksym == event.key.keysym.sym)
+ goto breakout;
break;
case SDL_MOUSEWHEEL:
case SDL_MOUSEBUTTONUP:
@@ -563,6 +568,7 @@ run(Uxn *u)
uxn_eval(u, peek16((devaudio0 + (event.type - audio0_event))->dat, 0));
}
}
+breakout:
uxn_eval(u, devscreen->vector);
if(ppu.reqdraw || devsystem->dat[0xe])
redraw(u);