diff --git a/input/common/wayland_common.c b/input/common/wayland_common.c index 1a36c61b602..bbd9fce9a81 100644 --- a/input/common/wayland_common.c +++ b/input/common/wayland_common.c @@ -213,6 +213,8 @@ static void wl_pointer_handle_leave(void *data, wl->input.mouse.left = false; wl->input.mouse.right = false; wl->input.mouse.middle = false; + wl->input.mouse.side = false; + wl->input.mouse.extra = false; if (wl->input.mouse.surface == surface) wl->input.mouse.surface = NULL; @@ -270,6 +272,12 @@ static void wl_pointer_handle_button(void *data, case BTN_MIDDLE: wl->input.mouse.middle = true; break; + case BTN_SIDE: + wl->input.mouse.side = true; + break; + case BTN_EXTRA: + wl->input.mouse.extra = true; + break; } } else @@ -285,6 +293,12 @@ static void wl_pointer_handle_button(void *data, case BTN_MIDDLE: wl->input.mouse.middle = false; break; + case BTN_SIDE: + wl->input.mouse.side = false; + break; + case BTN_EXTRA: + wl->input.mouse.extra = false; + break; } } } diff --git a/input/common/wayland_common.h b/input/common/wayland_common.h index 8ed1f99f33e..e99ef701ec7 100644 --- a/input/common/wayland_common.h +++ b/input/common/wayland_common.h @@ -123,7 +123,7 @@ typedef struct input_ctx_wayland_data int delta_x, delta_y; bool last_valid; bool focus; - bool left, right, middle; + bool left, right, middle, side, extra; bool wu, wd, wl, wr; } mouse; diff --git a/input/drivers/wayland_input.c b/input/drivers/wayland_input.c index 6523f5e7206..e3e0a55c575 100644 --- a/input/drivers/wayland_input.c +++ b/input/drivers/wayland_input.c @@ -284,7 +284,18 @@ static int16_t input_wl_state( return wl->mouse.right; case RETRO_DEVICE_ID_MOUSE_MIDDLE: return wl->mouse.middle; - /* TODO/FIXME: Rest of the mouse inputs. */ + case RETRO_DEVICE_ID_MOUSE_BUTTON_4: + return wl->mouse.side; + case RETRO_DEVICE_ID_MOUSE_BUTTON_5: + return wl->mouse.extra; + case RETRO_DEVICE_ID_MOUSE_HORIZ_WHEELDOWN: + state = wl->mouse.wl; + wl->mouse.wl = false; + return state; + case RETRO_DEVICE_ID_MOUSE_HORIZ_WHEELUP: + state = wl->mouse.wr; + wl->mouse.wr = false; + return state; } } break;