diff options
author | rodri <rgl@antares-labs.eu> | 2024-11-16 14:10:47 +0000 |
---|---|---|
committer | rodri <rgl@antares-labs.eu> | 2024-11-16 14:10:47 +0000 |
commit | 28cacde37de17e1f471b215e55d644b53881a24b (patch) | |
tree | 16d257978016261d81e400daeb0827546d79e5a6 | |
parent | 8f1306dfeadd090819c1257d2d4c244e52f98614 (diff) | |
download | battleship-28cacde37de17e1f471b215e55d644b53881a24b.tar.gz battleship-28cacde37de17e1f471b215e55d644b53881a24b.tar.bz2 battleship-28cacde37de17e1f471b215e55d644b53881a24b.zip |
bts: fix confirmdone().
-rw-r--r-- | bts.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -708,15 +708,16 @@ confirmdone(Mousectl *mc) }; csetcursor(mc, &anchor); - readmouse(mc); - while(mc->buttons == 0) + while(mc->buttons != 0) /* ignore any buttons already pressed */ + readmouse(mc); + while(mc->buttons == 0) /* wait for a button press */ readmouse(mc); if(mc->buttons != 4){ while(nbrecv(kctl->c, nil)) /* flush key presses */ csetcursor(mc, nil); return 0; } - while(mc->buttons){ + while(mc->buttons){ /* commit action on button release */ if(mc->buttons != 4){ while(nbrecv(kctl->c, nil)); csetcursor(mc, nil); |