diff options
author | epoch <epoch@hacking.allowed.org> | 2020-07-17 04:27:34 -0500 |
---|---|---|
committer | epoch <epoch@hacking.allowed.org> | 2020-07-17 04:27:34 -0500 |
commit | b93aaf12a23d64afa92e77f59d084c019327f645 (patch) | |
tree | b3140a38c8540ab1f45955b646ae1068c1b01a9d | |
parent | d83b9196d88dcc934d47f4609310a9840390fa9b (diff) | |
download | hackvr-b93aaf12a23d64afa92e77f59d084c019327f645.tar.gz hackvr-b93aaf12a23d64afa92e77f59d084c019327f645.zip |
got the secondary and tertiary buttons swapped around. oops.
-rw-r--r-- | src/mouse_x11.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/mouse_x11.c b/src/mouse_x11.c index 8218c98..623dd68 100644 --- a/src/mouse_x11.c +++ b/src/mouse_x11.c @@ -15,8 +15,8 @@ int mouse_init() { } #define X11_MOUSE_PRIMARY 1 -#define X11_MOUSE_SECONDARY 2 -#define X11_MOUSE_TERTIARY 3 +#define X11_MOUSE_SECONDARY 3 +#define X11_MOUSE_TERTIARY 2 #define X11_MOUSE_SCROLLUP 4 #define X11_MOUSE_SCROLLDOWN 5 @@ -47,7 +47,7 @@ int mouse_event_handler() {//this returns HVM_ key + for buttondown and - for bu switch(e.type) { case ButtonPress: //e.xbutton.button == 1 for first button. we don't need to start at 1. let's start at 0 with the -1 //scroll wheel up is 3, down is 4 if((butt=x112map(e.xbutton.button)) == -1) { - continue;//we don't know how to handle this button. :/ + continue;//we don't know how to handle this button. :/ } fprintf(stderr,"# x11 button: %d is %d in hackvr\n",e.xbutton.button,butt); if(butt == MOUSE_SCROLLUP) {//scroll wheel up @@ -66,6 +66,9 @@ int mouse_event_handler() {//this returns HVM_ key + for buttondown and - for bu redrawplzkthx=1; break; case ButtonRelease: + if((butt=x112map(e.xbutton.button)) == -1) { + continue;//we don't know how to handle this button. :/ + } printf("# button release %d\n",butt); gra_global.mousemap[butt]=-1;//we can trigger on -1 or on 1 then set back to 0 to prevent double-trigger gr=get_group_relative(global.user); |