* [PATCH] ui: Add more mouse buttons to SPICE
@ 2020-08-20 14:58 Frediano Ziglio
2020-08-31 8:41 ` Gerd Hoffmann
0 siblings, 1 reply; 5+ messages in thread
From: Frediano Ziglio @ 2020-08-20 14:58 UTC (permalink / raw)
To: Gerd Hoffmann; +Cc: qemu-devel, Frediano Ziglio
From: Frediano Ziglio <freddy77@gmail.com>
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>
---
ui/spice-input.c | 2 ++
1 file changed, 2 insertions(+)
See also https://gitlab.freedesktop.org/spice/spice/-/merge_requests/140
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) {
--
2.25.4
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] ui: Add more mouse buttons to SPICE
2020-08-20 14:58 [PATCH] ui: Add more mouse buttons to SPICE Frediano Ziglio
@ 2020-08-31 8:41 ` Gerd Hoffmann
0 siblings, 0 replies; 5+ messages in thread
From: Gerd Hoffmann @ 2020-08-31 8:41 UTC (permalink / raw)
To: Frediano Ziglio; +Cc: qemu-devel, Frediano Ziglio
> + [INPUT_BUTTON_SIDE] = 0x40,
> + [INPUT_BUTTON_EXTRA] = 0x80,
Added to UI patch queue.
thanks,
Gerd
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] ui: Add more mouse buttons to SPICE
2020-08-20 13:00 Frediano Ziglio
@ 2020-08-20 13:26 ` Marc-André Lureau
0 siblings, 0 replies; 5+ messages in thread
From: Marc-André Lureau @ 2020-08-20 13:26 UTC (permalink / raw)
To: Frediano Ziglio; +Cc: Frediano Ziglio, Gerd Hoffmann, QEMU
[-- Attachment #1: Type: text/plain, Size: 945 bytes --]
Hi
On Thu, Aug 20, 2020 at 5:01 PM Frediano Ziglio <fziglio@redhat.com> wrote:
> From: Frediano Ziglio <freddy77@gmail.com>
>
> Add support for SIDE and EXTRA buttons.
>
> Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
> ---
> ui/spice-input.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> 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) {
> --
> 2.25.4
>
>
I don't see where those values are defined, can you describe it a bit?
thanks
--
Marc-André Lureau
[-- Attachment #2: Type: text/html, Size: 1584 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH] ui: Add more mouse buttons to SPICE
@ 2020-08-20 13:00 Frediano Ziglio
2020-08-20 13:26 ` Marc-André Lureau
0 siblings, 1 reply; 5+ messages in thread
From: Frediano Ziglio @ 2020-08-20 13:00 UTC (permalink / raw)
To: Gerd Hoffmann; +Cc: qemu-devel, Frediano Ziglio
From: Frediano Ziglio <freddy77@gmail.com>
Add support for SIDE and EXTRA buttons.
Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
---
ui/spice-input.c | 2 ++
1 file changed, 2 insertions(+)
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) {
--
2.25.4
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH] ui: Add more mouse buttons to SPICE
@ 2020-08-20 11:05 Frediano Ziglio
0 siblings, 0 replies; 5+ messages in thread
From: Frediano Ziglio @ 2020-08-20 11:05 UTC (permalink / raw)
To: Gerd Hoffmann; +Cc: qemu-devel, Frediano Ziglio
Add support for SIDE and EXTRA buttons.
Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
---
ui/spice-input.c | 2 ++
1 file changed, 2 insertions(+)
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) {
--
2.25.4
^ permalink raw reply related [flat|nested] 5+ messages in thread
end of thread, other threads:[~2020-08-31 8:48 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-20 14:58 [PATCH] ui: Add more mouse buttons to SPICE Frediano Ziglio
2020-08-31 8:41 ` Gerd Hoffmann
-- strict thread matches above, loose matches on Subject: below --
2020-08-20 13:00 Frediano Ziglio
2020-08-20 13:26 ` Marc-André Lureau
2020-08-20 11:05 Frediano Ziglio
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).