summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin Pouget <kpouget@redhat.com>2020-05-14 16:19:55 +0200
committerJoan Bruguera <joanbrugueram@gmail.com>2022-01-18 00:54:50 +0100
commit67090358b332c05bc66c07cc1c3f076ba4ded277 (patch)
tree127fc6aed0cc692c33d84da2085098eec9b54950
parent09de02fd5cb12fcda3326e243981750c5358b7b6 (diff)
vdagentd/uinput: Handle side mouse buttons (BTN_SIDE and BTN_EXTRA)
Adds support for handling the side mouse buttons some mouses have, typically used in web browsers for previous/next website in history. spice-gtk requires a corresponding patch to capture and forward the buttons. At the spice and protocol level, the required changes were previously merged: * https://gitlab.freedesktop.org/spice/spice/-/issues/45 * https://gitlab.freedesktop.org/spice/spice/-/merge_requests/140 * https://gitlab.freedesktop.org/spice/spice-protocol/-/merge_requests/22 This commit is a rebased and revised version of the patch by Kevin Pouget: https://www.spinics.net/lists/spice-devel/msg42582.html (I have confirmed with him that it's OK that I submit the updated patches.) Co-Authored-By: Kevin Pouget <kpouget@redhat.com> Co-Authored-By: Joan Bruguera <joanbrugueram@gmail.com>
-rw-r--r--src/vdagentd/uinput.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/vdagentd/uinput.c b/src/vdagentd/uinput.c
index ff37e1e..e50e095 100644
--- a/src/vdagentd/uinput.c
+++ b/src/vdagentd/uinput.c
@@ -140,6 +140,8 @@ void vdagentd_uinput_update_size(struct vdagentd_uinput **uinputp,
ioctl(uinput->fd, UI_SET_KEYBIT, BTN_LEFT);
ioctl(uinput->fd, UI_SET_KEYBIT, BTN_MIDDLE);
ioctl(uinput->fd, UI_SET_KEYBIT, BTN_RIGHT);
+ ioctl(uinput->fd, UI_SET_KEYBIT, BTN_SIDE);
+ ioctl(uinput->fd, UI_SET_KEYBIT, BTN_EXTRA);
/* wheel */
ioctl(uinput->fd, UI_SET_EVBIT, EV_REL);
@@ -200,6 +202,8 @@ void vdagentd_uinput_do_mouse(struct vdagentd_uinput **uinputp,
{ .name = "left", .mask = VD_AGENT_LBUTTON_MASK, .btn = BTN_LEFT },
{ .name = "middle", .mask = VD_AGENT_MBUTTON_MASK, .btn = BTN_MIDDLE },
{ .name = "right", .mask = VD_AGENT_RBUTTON_MASK, .btn = BTN_RIGHT },
+ { .name = "side" , .mask = VD_AGENT_SBUTTON_MASK, .btn = BTN_SIDE },
+ { .name = "extra" , .mask = VD_AGENT_EBUTTON_MASK, .btn = BTN_EXTRA },
};
static const struct button_s wheel[] = {
{ .name = "up", .mask = VD_AGENT_UBUTTON_MASK, .btn = 1 },