aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrodri <rgl@antares-labs.eu>2023-09-15 22:15:25 +0000
committerrodri <rgl@antares-labs.eu>2023-09-15 22:15:25 +0000
commit48fe28aa56b83af341957b472c023a667639776c (patch)
tree0a9981bf2b9f0eed983802bc1d80b944f6f2b034
parent651db54ad2917ea0e055b74047201ef0b6022e63 (diff)
downloadbattleship-48fe28aa56b83af341957b472c023a667639776c.tar.gz
battleship-48fe28aa56b83af341957b472c023a667639776c.tar.bz2
battleship-48fe28aa56b83af341957b472c023a667639776c.zip
fix mouse button handling.
-rw-r--r--bts.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/bts.c b/bts.c
index 6d7a22e..85b8459 100644
--- a/bts.c
+++ b/bts.c
@@ -645,18 +645,18 @@ mouse(Mousectl *mc)
else
csetcursor(mctl, nil);
- switch(mc->buttons){
- case 1:
- lmb(mc);
- break;
- case 2:
- if(oldm.buttons != 2)
+ if(oldm.buttons != mc->buttons)
+ switch(mc->buttons){
+ case 1:
+ lmb(mc);
+ break;
+ case 2:
mmb(mc);
- break;
- case 4:
- rmb(mc);
- break;
- }
+ break;
+ case 4:
+ rmb(mc);
+ break;
+ }
oldm = mc->Mouse;
}