summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrediano Ziglio2020-08-20 16:58:51 +0200
committerGerd Hoffmann2020-09-04 07:32:28 +0200
commit5b57a87e4eb42c78e26c88dd7d88005c55b93be1 (patch)
treec44c2092376ed0cc9bcf986652f61ffe7f6a13da
parentvnc-auth-sasl: Plug memleak in vnc_socket_ip_addr_string (diff)
downloadqemu-5b57a87e4eb42c78e26c88dd7d88005c55b93be1.tar.gz
qemu-5b57a87e4eb42c78e26c88dd7d88005c55b93be1.tar.xz
qemu-5b57a87e4eb42c78e26c88dd7d88005c55b93be1.zip
ui: Add more mouse buttons to SPICE
Add support for SIDE and EXTRA buttons. The constants for buttons in both SPICE and QEMU are defined as LEFT MIDDLE RIGHT UP DOWN SIDE EXTRA (same order). "button_mask" contains for each bit the state of a button. Qemu currently uses bits 0, 1, 2 respectively as LEFT, RIGHT, MIDDLE; also add bits 4 and 5 as UP and DOWN (using wheel movements). SPICE protocol uses a bitmask based on the order above where LEFT is bit 0, MIDDLE is bit 1 and so on till EXTRA being bit 6. To avoid clash with Qemu usage SPICE bitmask from SIDE are move a bit more resulting respectively in 0x40 and 0x80 values. Signed-off-by: Frediano Ziglio <freddy77@gmail.com> Message-id: 20200820145851.50846-1-fziglio@redhat.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
-rw-r--r--ui/spice-input.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/ui/spice-input.c b/ui/spice-input.c
index cd4bb0043f..d5bba231c9 100644
--- a/ui/spice-input.c
+++ b/ui/spice-input.c
@@ -123,6 +123,8 @@ static void spice_update_buttons(QemuSpicePointer *pointer,
[INPUT_BUTTON_RIGHT] = 0x02,
[INPUT_BUTTON_WHEEL_UP] = 0x10,
[INPUT_BUTTON_WHEEL_DOWN] = 0x20,
+ [INPUT_BUTTON_SIDE] = 0x40,
+ [INPUT_BUTTON_EXTRA] = 0x80,
};
if (wheel < 0) {