Add support for X1 and X2 mouse buttons

This commit is contained in:
Cameron Gutman
2018-10-08 19:49:33 -07:00
committed by Iwan Timmer
parent c52ba9c041
commit e21e2074e3
4 changed files with 19 additions and 1 deletions

View File

@@ -246,6 +246,12 @@ static bool evdev_handle_event(struct input_event *ev, struct input_device *dev)
case BTN_RIGHT: case BTN_RIGHT:
mouseCode = BUTTON_RIGHT; mouseCode = BUTTON_RIGHT;
break; break;
case BTN_SIDE:
mouseCode = BUTTON_X1;
break;
case BTN_EXTRA:
mouseCode = BUTTON_X2;
break;
default: default:
gamepadModified = true; gamepadModified = true;
if (dev->map == NULL) if (dev->map == NULL)

View File

@@ -96,6 +96,12 @@ int sdlinput_handle_event(SDL_Event* event) {
case SDL_BUTTON_RIGHT: case SDL_BUTTON_RIGHT:
button = BUTTON_RIGHT; button = BUTTON_RIGHT;
break; break;
case SDL_BUTTON_X1:
button = BUTTON_X1;
break;
case SDL_BUTTON_X2:
button = BUTTON_X2;
break;
} }
if (button != 0) if (button != 0)

View File

@@ -110,6 +110,12 @@ static int x11_handler(int fd) {
case Button5: case Button5:
LiSendScrollEvent(-1); LiSendScrollEvent(-1);
break; break;
case 8:
button = BUTTON_X1;
break;
case 9:
button = BUTTON_X2;
break;
} }
if (button != 0) if (button != 0)