Re: [Spice-devel] spice-vdagent: how to enable additional mouse buttons?

2020-05-14 Thread bruts
Hi Frediano,



Yes it's quite a bit incoherent, having said that, i just saw a picture of a 
mouse with like 30 buttons on it :-)

Didn't have time yet to test your patches Kevin, will do so in evening hours, I 
will update you after.



>From the bottom of my thumb, i thank you :-)



Roger



De : Frediano Ziglio 
À : Kevin Pouget 
Sujet : Re: [Spice-devel] spice-vdagent: how to enable additional mouse buttons?
Date : 14/05/2020 17:12:01 Europe/Paris
Copie à : br...@netc.fr;
   Spice devel 

> Hello,

> I've pushed some commits to get the mouse buttons working with the VDAgent
> (and only it, some bits are missing in spice-server to handle the other
> types I think):

> https://gitlab.freedesktop.org/kpouget/spice/-/commits/exp/mouse-bt
> https://gitlab.freedesktop.org/kpouget/spice-gtk/-/commits/exp/mouse-bt
> https://gitlab.freedesktop.org/kpouget/spice-protocol/-/commits/exp/mouse-bt
> https://gitlab.freedesktop.org/kpouget/vd_agent/-/tree/exp/mouse-bt

Nine and simple! Thanks!

Wondering why there's no SPICE_MOUSE_BUTTON_MASK_UP and 
SPICE_MOUSE_BUTTON_MASK_DOWN.
It looks a bit incoherent.
Not a regression of your patches. Maybe they don't change some internal status

> and I uploaded a small demo of the way it works in my workstation: my mouse
> has 2 extra buttons (8 and 9) that are properly forwarded
> > http://people.redhat.com/~kpouget/20-05-14/mouse-bt.mkv

> I hope it will work the same on your side!

> On Wed, May 13, 2020 at 11:20 AM < br...@netc.fr > wrote:

> > Hi Kevin and Frediano,
> 

> > Yes there might be issues like Frediano is pointing out, probably they are
> > not well defined, so it might be not trivial to create something for the
> > public out of this.
> 
> > Still I wonder why there are these entries in
> > /usr/include/linux/input-event-codes.h:
> 
> > #define BTN_MOUSE 0x110
> 
> > #define BTN_LEFT 0x110
> 
> > #define BTN_RIGHT 0x111
> 
> > #define BTN_MIDDLE 0x112
> 
> > #define BTN_SIDE 0x113
> 
> > #define BTN_EXTRA 0x114
> 
> > #define BTN_FORWARD 0x115
> 
> > #define BTN_BACK 0x116
> 
> > #define BTN_TASK 0x117
> 

> > They must have some meaning no? Perhaps they are matched to different mouse
> > buttons, like one time to button 8, the other mouse declares it as button
> > 10, that is what you mean?
> 

> > Still I would be very happy if Kevin would have the time to make a little
> > patch, or an approach to that little patch, so I could use it for my
> > individual mouse buttons, I understand it is not easy to get this out to
> > the
> > public, still if there is a patch available in the mailing list, then at
> > least people can grab that and change it to their liking, right?
> 

> > Anyway, all the replies and help is appreciated! Let's get my thumb happy
> > and
> > give him that mouse button ;)
> 

> > > De : Frediano Ziglio < fzig...@redhat.com >
> > 
> 
> > > À : Kevin Pouget < kpou...@redhat.com >
> > 
> 
> > > Sujet : Re: [Spice-devel] spice-vdagent: how to enable additional mouse
> > > buttons?
> > 
> 
> > > Date : 13/05/2020 09:49:45 Europe/Paris
> > 
> 
> > > Copie à : br...@netc.fr ;
> > 
> 
> > > Spice devel < spice-devel@lists.freedesktop.org >
> > 
> 

> > > Hi,
> > 
> 
> > > if I remember I think the main issue is that these buttons are kind of
> > > wild
> > > west.
> > 
> 
> > > Basically what is button 6 (first 5 are well defined) ? It can be
> > > anything
> > > so
> > > it could
> > 
> 
> > > be that for instance my client left becomes right on the guest.
> > 
> 
> > > Maybe just changing mouse model the semantic of the buttons on the guest
> > > change.
> > 
> 
> > > Also I remember that GTK had some problems, these buttons are not
> > > defined,
> > > I
> > > think
> > 
> 
> > > they are passed from the underlying system (Windows, X11, Wayland).
> > 
> 

> > > However I see two "workaround":
> > 
> 
> > > 1- let the users take care of the mismatch. Either getting used to use a
> > > button
> > 
> 
> > > instead of the other or using some tools;
> > 
> 
> > > 2- add a message to communicate the meaning of the various buttons (which
> > > can
> > 
> 
> > > change for instance changing mouse).
> > 
> 

> > > I think 1 is what was implemented by the patches, I'd go for this way.
> > 
> 
> > > I hope softwares are not associating button semantics to computer
> > > shutdown
> > 
> 
> > > or something "dangerous" like this.
> > 
> 

> > > Frediano
> > 
> 

> > > > On Tue, May 12, 2020 at 11:58 PM < br...@netc.fr > wrote:
> > > 
> > 
> 

> > > > > Hi Victor,
> > > > 
> > > 
> > 
> 

> > > > > Yes it was certainly a good read and i got some ideas from it, but
> > > > > the
> > > > > code
> > > > > has changed quite a lot since 2017 and the patches correspond to the
> > > > > current
> > > > > code only for about 10-15%.
> > > > 
> > > 
> > 
> 
> > > > > Maybe someone from the Spice team can suggest a patch to add
> > > > > additional
> > > > > mouse
> > > > > buttons - i am sure that it would be a matter of minutes to an hour
> > > > > for
> > > > > 

Re: [Spice-devel] spice-vdagent: how to enable additional mouse buttons?

2020-05-14 Thread bruts

Good afternoon Kevin,



That is some great news! Let me get to testing this on my side and give you 
feedback on it.

It makes sense people want their other mouse buttons to work on a guest system, 
so your work on this will for sure be worth the time and will make many people 
happy I am sure.

I will get back to you asap, thanks so much!



Roger


De : Kevin Pouget 
À : br...@netc.fr
Sujet : Re: [Spice-devel] spice-vdagent: how to enable additional mouse buttons?
Date : 14/05/2020 16:37:36 Europe/Paris
Copie à : Frediano Ziglio ;
   Spice devel 

Hello,



I've pushed some commits to get the mouse buttons working with the VDAgent (and 
only it, some bits are missing in spice-server to handle the other types I 
think):



https://gitlab.freedesktop.org/kpouget/spice/-/commits/exp/mouse-bt

https://gitlab.freedesktop.org/kpouget/spice-gtk/-/commits/exp/mouse-bt

https://gitlab.freedesktop.org/kpouget/spice-protocol/-/commits/exp/mouse-bt

https://gitlab.freedesktop.org/kpouget/vd_agent/-/tree/exp/mouse-bt



and I uploaded a small demo of the way it works in my workstation: my mouse has 
2 extra buttons (8 and 9) that are properly forwarded

> http://people.redhat.com/~kpouget/20-05-14/mouse-bt.mkv 



I hope it will work the same on your side!



On Wed, May 13, 2020 at 11:20 AM  wrote:

Hi Kevin and Frediano,



Yes there might be issues like Frediano is pointing out, probably they are not 
well defined, so it might be not trivial to create something for the public out 
of this.

Still I wonder why there are these entries in 
/usr/include/linux/input-event-codes.h:
#define BTN_MOUSE   0x110
#define BTN_LEFT    0x110
#define BTN_RIGHT   0x111
#define BTN_MIDDLE  0x112
#define BTN_SIDE    0x113
#define BTN_EXTRA   0x114
#define BTN_FORWARD 0x115
#define BTN_BACK    0x116
#define BTN_TASK    0x117



They must have some meaning no? Perhaps they are matched to different mouse 
buttons, like one time to button 8, the other mouse declares it as button 10, 
that is what you mean?



Still I would be very happy if Kevin would have the time to make a little 
patch, or an approach to that little patch, so I could use it for my individual 
mouse buttons, I understand it is not easy to get this out to the public, still 
if there is a patch available in the mailing list, then at least people can 
grab that and change it to their liking, right?



Anyway, all the replies and help is appreciated! Let's get my thumb happy and 
give him that mouse button ;)




De : Frediano Ziglio 
À : Kevin Pouget 
Sujet : Re: [Spice-devel] spice-vdagent: how to enable additional mouse buttons?
Date : 13/05/2020 09:49:45 Europe/Paris
Copie à : br...@netc.fr;
   Spice devel 

Hi,

  if I remember I think the main issue is that these buttons are kind of wild 
west.

Basically what is button 6 (first 5 are well defined) ? It can be anything so 
it could

be that for instance my client left becomes right on the guest.

Maybe just changing mouse model the semantic of the buttons on the guest change.

Also I remember that GTK had some problems, these buttons are not defined, I 
think

they are passed from the underlying system (Windows, X11, Wayland).



However I see two "workaround":

1- let the users take care of the mismatch. Either getting used to use a button

   instead of the other or using some tools;

2- add a message to communicate the meaning of the various buttons (which can

   change for instance changing mouse).



I think 1 is what was implemented by the patches, I'd go for this way.

I hope softwares are not associating button semantics to computer shutdown

or something "dangerous" like this.



Frediano






On Tue, May 12, 2020 at 11:58 PM  wrote:

Hi Victor,



Yes it was certainly a good read and i got some ideas from it, but the code has 
changed quite a lot since 2017 and the patches correspond to the current code 
only for about 10-15%.

Maybe someone from the Spice team can suggest a patch to add additional mouse 
buttons - i am sure that it would be a matter of minutes to an hour for anyone 
who is involved with coding the spice-vdagent project to create a general patch 
idea to add additional mouse buttons



Hello,



I'll give it a try this morning, indeed it shouldn't require (much|any) new 
code, only flags here and there. Let's see



Kevin

 



It is just a matter of forwarding them to the guest - for some reason it was 
decided not to add them.



thanks!






De : Victor Toso 
À : br...@netc.fr
Sujet : Re: [Spice-devel] spice-vdagent: how to enable additional mouse buttons?
Date : 12/05/2020 07:25:59 Europe/Paris
Copie à : u...@redhat.com;
   spice-devel@lists.freedesktop.org

Hi,

On Tue, May 12, 2020 at 12:53:02AM +0200, br...@netc.fr wrote:
> 
> 
> Uri (and others),
> 
> I found the similar question in a few corners of the internet
> and I think adding at least the additional default mouse

Re: [Spice-devel] spice-vdagent: how to enable additional mouse buttons?

2020-05-13 Thread bruts
Hi Kevin and Frediano,



Yes there might be issues like Frediano is pointing out, probably they are not 
well defined, so it might be not trivial to create something for the public out 
of this.

Still I wonder why there are these entries in 
/usr/include/linux/input-event-codes.h:
#define BTN_MOUSE   0x110
#define BTN_LEFT    0x110
#define BTN_RIGHT   0x111
#define BTN_MIDDLE  0x112
#define BTN_SIDE    0x113
#define BTN_EXTRA   0x114
#define BTN_FORWARD 0x115
#define BTN_BACK    0x116
#define BTN_TASK    0x117



They must have some meaning no? Perhaps they are matched to different mouse 
buttons, like one time to button 8, the other mouse declares it as button 10, 
that is what you mean?



Still I would be very happy if Kevin would have the time to make a little 
patch, or an approach to that little patch, so I could use it for my individual 
mouse buttons, I understand it is not easy to get this out to the public, still 
if there is a patch available in the mailing list, then at least people can 
grab that and change it to their liking, right?



Anyway, all the replies and help is appreciated! Let's get my thumb happy and 
give him that mouse button ;)




De : Frediano Ziglio 
À : Kevin Pouget 
Sujet : Re: [Spice-devel] spice-vdagent: how to enable additional mouse buttons?
Date : 13/05/2020 09:49:45 Europe/Paris
Copie à : br...@netc.fr;
   Spice devel 

Hi,

  if I remember I think the main issue is that these buttons are kind of wild 
west.

Basically what is button 6 (first 5 are well defined) ? It can be anything so 
it could

be that for instance my client left becomes right on the guest.

Maybe just changing mouse model the semantic of the buttons on the guest change.

Also I remember that GTK had some problems, these buttons are not defined, I 
think

they are passed from the underlying system (Windows, X11, Wayland).



However I see two "workaround":

1- let the users take care of the mismatch. Either getting used to use a button

   instead of the other or using some tools;

2- add a message to communicate the meaning of the various buttons (which can

   change for instance changing mouse).



I think 1 is what was implemented by the patches, I'd go for this way.

I hope softwares are not associating button semantics to computer shutdown

or something "dangerous" like this.



Frediano






On Tue, May 12, 2020 at 11:58 PM  wrote:

Hi Victor,



Yes it was certainly a good read and i got some ideas from it, but the code has 
changed quite a lot since 2017 and the patches correspond to the current code 
only for about 10-15%.

Maybe someone from the Spice team can suggest a patch to add additional mouse 
buttons - i am sure that it would be a matter of minutes to an hour for anyone 
who is involved with coding the spice-vdagent project to create a general patch 
idea to add additional mouse buttons



Hello,



I'll give it a try this morning, indeed it shouldn't require (much|any) new 
code, only flags here and there. Let's see



Kevin

 



It is just a matter of forwarding them to the guest - for some reason it was 
decided not to add them.



thanks!






De : Victor Toso 
À : br...@netc.fr
Sujet : Re: [Spice-devel] spice-vdagent: how to enable additional mouse buttons?
Date : 12/05/2020 07:25:59 Europe/Paris
Copie à : u...@redhat.com;
   spice-devel@lists.freedesktop.org

Hi,

On Tue, May 12, 2020 at 12:53:02AM +0200, br...@netc.fr wrote:
> 
> 
> Uri (and others),
> 
> I found the similar question in a few corners of the internet
> and I think adding at least the additional default mouse
> buttons should not be all that much work.

You can take a look at this proposal to adding horizontal wheel
support to Spice

https://lists.freedesktop.org/archives/spice-devel/2017-October/040558.html

> With some guidance I could probably do it myself, though the
> guidance would need to be quite substantial :)
> 
> The mouse and the main buttons is already forwarded and that is
> the main part.
> 
> with xev it is clear to see which buttons work on the host, but
> not on the guest.
> 
> Anyone with some spare time (which I know is always limited for
> everyone), but help me where to fix this in the code and i will
> write a patch - or give me a good start - or start yourself.
> 
> a semi working mouse in the guest is very annoying and can be
> one of the critical points why to use spice (or not) - at least
> i know it is in my case.
> 
> Thanks!!

Cheers,
Victor

___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/spice-devel



___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/spice-devel





___
Spice-devel mailing list

Re: [Spice-devel] spice-vdagent: how to enable additional mouse buttons?

2020-05-12 Thread bruts
Hi Victor,



Yes it was certainly a good read and i got some ideas from it, but the code has 
changed quite a lot since 2017 and the patches correspond to the current code 
only for about 10-15%.

Maybe someone from the Spice team can suggest a patch to add additional mouse 
buttons - i am sure that it would be a matter of minutes to an hour for anyone 
who is involved with coding the spice-vdagent project to create a general patch 
idea to add additional mouse buttons



It is just a matter of forwarding them to the guest - for some reason it was 
decided not to add them.



thanks!





De : Victor Toso 
À : br...@netc.fr
Sujet : Re: [Spice-devel] spice-vdagent: how to enable additional mouse buttons?
Date : 12/05/2020 07:25:59 Europe/Paris
Copie à : u...@redhat.com;
   spice-devel@lists.freedesktop.org

Hi,

On Tue, May 12, 2020 at 12:53:02AM +0200, br...@netc.fr wrote:
> 
> 
> Uri (and others),
> 
> I found the similar question in a few corners of the internet
> and I think adding at least the additional default mouse
> buttons should not be all that much work.

You can take a look at this proposal to adding horizontal wheel
support to Spice

https://lists.freedesktop.org/archives/spice-devel/2017-October/040558.html

> With some guidance I could probably do it myself, though the
> guidance would need to be quite substantial :)
> 
> The mouse and the main buttons is already forwarded and that is
> the main part.
> 
> with xev it is clear to see which buttons work on the host, but
> not on the guest.
> 
> Anyone with some spare time (which I know is always limited for
> everyone), but help me where to fix this in the code and i will
> write a patch - or give me a good start - or start yourself.
> 
> a semi working mouse in the guest is very annoying and can be
> one of the critical points why to use spice (or not) - at least
> i know it is in my case.
> 
> Thanks!!

Cheers,
Victor


___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/spice-devel


Re: [Spice-devel] spice-vdagent: how to enable additional mouse buttons?

2020-05-11 Thread bruts
ime 366949, (127,94), root:(128,144),
>>     state 0x0, button 8, same_screen YES
>>
>> ButtonPress event, serial 48, synthetic NO, window 0x301,
>>     root 0x3ad, subw 0x0, time 368093, (127,94), root:(128,144),
>>     state 0x0, button 9, same_screen YES
>>
>> ButtonRelease event, serial 48, synthetic NO, window 0x301,
>>     root 0x3ad, subw 0x0, time 368250, (127,94), root:(128,144),
>>     state 0x0, button 9, same_screen YES
>>
>>
>>
>> Now the next question is obvious: how do I adjust the code to add support 
>> for button 8,9 ?
>>
>>
>>
>> I thought BTN_LEFT and BTN_RIGHT would be declared in uinput.h but they are 
>> global variables? or where are they declared?
> 
> I found them in
> /usr/include/linux/input-event-codes.h.
> There is also BTN_BACK but I'm not sure it's mapped to any of button-8
> or 9.
> 
> Uri.
> 
>>
>> Any help with adding support for these buttons would be very appreciated and 
>> finally make me stop using virtualbox lol.
>>
>> Thanks!
>>
>>
>>
>>
>>
>>
>>
>> De : Uri Lublin 
>> À : br...@netc.fr;
>>    spice-devel@lists.freedesktop.org
>> Sujet : Re: [Spice-devel] spice-vdagent: how to enable additional mouse 
>> buttons?
>> Date : 03/05/2020 17:33:55 Europe/Paris
>>
>> On 5/1/20 3:51 PM, br...@netc.fr wrote:
>>>
>>> I am using spice-vdagent on most of my qemu-kvm vm's, while this is very
>>> convenient, mouse button 8 and 9 are not working (those are the side
>>> buttons of the mouse, one is often used for BACK function of the
>>> browser, which my thumb is actually addicted to).
>>> How could i make these buttons work with spice-vdagent?
>>
>> Hi,
>>
>> Currently 5 mouse buttons are supported. I think some code is needed to
>> be added in order to support more buttons.
>>
>> Uri.
>>
>>>
>>> Thanks for the suggestions,
>>>
>>> Bruts
>>
>>
>>
> 
> 
> 


___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/spice-devel


Re: [Spice-devel] spice-vdagent: how to enable additional mouse buttons?

2020-05-11 Thread bruts
 0x0, button 9, same_screen YES
>>
>> ButtonRelease event, serial 48, synthetic NO, window 0x301,
>>     root 0x3ad, subw 0x0, time 368250, (127,94), root:(128,144),
>>     state 0x0, button 9, same_screen YES
>>
>>
>>
>> Now the next question is obvious: how do I adjust the code to add support 
>> for button 8,9 ?
>>
>>
>>
>> I thought BTN_LEFT and BTN_RIGHT would be declared in uinput.h but they are 
>> global variables? or where are they declared?
> 
> I found them in
> /usr/include/linux/input-event-codes.h.
> There is also BTN_BACK but I'm not sure it's mapped to any of button-8
> or 9.
> 
> Uri.
> 
>>
>> Any help with adding support for these buttons would be very appreciated and 
>> finally make me stop using virtualbox lol.
>>
>> Thanks!
>>
>>
>>
>>
>>
>>
>>
>> De : Uri Lublin 
>> À : br...@netc.fr;
>>    spice-devel@lists.freedesktop.org
>> Sujet : Re: [Spice-devel] spice-vdagent: how to enable additional mouse 
>> buttons?
>> Date : 03/05/2020 17:33:55 Europe/Paris
>>
>> On 5/1/20 3:51 PM, br...@netc.fr wrote:
>>>
>>> I am using spice-vdagent on most of my qemu-kvm vm's, while this is very
>>> convenient, mouse button 8 and 9 are not working (those are the side
>>> buttons of the mouse, one is often used for BACK function of the
>>> browser, which my thumb is actually addicted to).
>>> How could i make these buttons work with spice-vdagent?
>>
>> Hi,
>>
>> Currently 5 mouse buttons are supported. I think some code is needed to
>> be added in order to support more buttons.
>>
>> Uri.
>>
>>>
>>> Thanks for the suggestions,
>>>
>>> Bruts
>>
>>
>>
> 
> 
> 


___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/spice-devel


Re: [Spice-devel] spice-vdagent: how to enable additional mouse buttons?

2020-05-11 Thread bruts


Uri,



Would it be as simple as adding:



ioctl(uinput->fd, UI_SET_KEYBIT,  BTN_BACK);

ioctl(uinput->fd, UI_SET_KEYBIT,  BTN_FORWARD);



and re-compiling / testing?



I am not an experienced coder and have not had the time yet to get a good 
overview of the spice-vdagent code, so this might be a too simple approach.



I guess all of these values might be tested:



#define BTN_MISC        0x100
#define BTN_0            0x100
#define BTN_1            0x101
#define BTN_2            0x102
#define BTN_3            0x103
#define BTN_4            0x104
#define BTN_5            0x105
#define BTN_6            0x106
#define BTN_7            0x107
#define BTN_8            0x108
#define BTN_9            0x109

#define BTN_MOUSE        0x110
#define BTN_LEFT        0x110
#define BTN_RIGHT        0x111
#define BTN_MIDDLE        0x112
#define BTN_SIDE        0x113
#define BTN_EXTRA        0x114
#define BTN_FORWARD        0x115
#define BTN_BACK        0x116
#define BTN_TASK        0x117



Is there any way to test the btn value? Like xev is not showing me anything 
related to this value?



Your input is appreciated!



Thanks





De : Uri Lublin 
À : br...@netc.fr;
   spice-devel@lists.freedesktop.org
Sujet : Re: [Spice-devel] spice-vdagent: how to enable additional mouse buttons?
Date : 11/05/2020 15:23:30 Europe/Paris

On 5/11/20 4:08 PM, br...@netc.fr wrote:
> Hi,
> 
> 
> 
> Yes most likely.
> 
> I find these lines of code:
> 
> 
> 
> /* buttons */
>     ioctl(uinput->fd, UI_SET_EVBIT, EV_KEY);
>     ioctl(uinput->fd, UI_SET_KEYBIT, BTN_LEFT);
>     ioctl(uinput->fd, UI_SET_KEYBIT, BTN_MIDDLE);
>     ioctl(uinput->fd, UI_SET_KEYBIT, BTN_RIGHT);
> 
>     /* wheel */
>     ioctl(uinput->fd, UI_SET_EVBIT, EV_REL);
>     ioctl(uinput->fd, UI_SET_RELBIT, REL_WHEEL);
> 
> 
> I will probably need to declare the additional mouse buttons of my mouse 
> (Logitech G403), so I run xev to find some information:
> 
> 
> 
> (BTN_LEFT, BTN_RIGHT, button 8, button 9)
> 
> 
> 
> ButtonPress event, serial 48, synthetic NO, window 0x301,
>     root 0x3ad, subw 0x0, time 361327, (127,94), root:(128,144),
>     state 0x0, button 1, same_screen YES
> 
> ButtonRelease event, serial 48, synthetic NO, window 0x301,
>     root 0x3ad, subw 0x0, time 361426, (127,94), root:(128,144),
>     state 0x100, button 1, same_screen YES
> 
> ButtonPress event, serial 48, synthetic NO, window 0x301,
>     root 0x3ad, subw 0x0, time 362448, (127,94), root:(128,144),
>     state 0x0, button 3, same_screen YES
> 
> ButtonRelease event, serial 48, synthetic NO, window 0x301,
>     root 0x3ad, subw 0x0, time 362556, (127,94), root:(128,144),
>     state 0x400, button 3, same_screen YES
> 
> ButtonPress event, serial 48, synthetic NO, window 0x301,
>     root 0x3ad, subw 0x0, time 366829, (127,94), root:(128,144),
>     state 0x0, button 8, same_screen YES
> 
> ButtonRelease event, serial 48, synthetic NO, window 0x301,
>     root 0x3ad, subw 0x0, time 366949, (127,94), root:(128,144),
>     state 0x0, button 8, same_screen YES
> 
> ButtonPress event, serial 48, synthetic NO, window 0x301,
>     root 0x3ad, subw 0x0, time 368093, (127,94), root:(128,144),
>     state 0x0, button 9, same_screen YES
> 
> ButtonRelease event, serial 48, synthetic NO, window 0x301,
>     root 0x3ad, subw 0x0, time 368250, (127,94), root:(128,144),
>     state 0x0, button 9, same_screen YES
> 
> 
> 
> Now the next question is obvious: how do I adjust the code to add support for 
> button 8,9 ?
> 
> 
> 
> I thought BTN_LEFT and BTN_RIGHT would be declared in uinput.h but they are 
> global variables? or where are they declared?

I found them in
/usr/include/linux/input-event-codes.h.
There is also BTN_BACK but I'm not sure it's mapped to any of button-8 
or 9.

Uri.

> 
> Any help with adding support for these buttons would be very appreciated and 
> finally make me stop using virtualbox lol.
> 
> Thanks!
> 
> 
> 
> 
> 
> 
> 
> De : Uri Lublin 
> À : br...@netc.fr;
>    spice-devel@lists.freedesktop.org
> Sujet : Re: [Spice-devel] spice-vdagent: how to enable additional mouse 
> buttons?
> Date : 03/05/2020 17:33:55 Europe/Paris
> 
> On 5/1/20 3:51 PM, br...@netc.fr wrote:
>>
>> I am using spice-vdagent on most of my qemu-kvm vm's, while this is very
>> convenient, mouse button 8 and 9 are not working (those are the side
>> buttons of the mouse, one is often used for BACK function of the
>> browser, which my thumb is actually addicted to).
>> How could i make these buttons work with spice-vdagent?
> 
> Hi,
> 
> Currently 5 mouse buttons are supported. I think some code is needed to
> be added in order to support more buttons.
> 
> Uri.
> 
>>
>> Thanks for the suggestions,
>>
>> Bruts
> 
> 
> 


___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/spice-devel


Re: [Spice-devel] spice-vdagent: how to enable additional mouse buttons?

2020-05-11 Thread bruts
Hi,



Yes most likely. 

I find these lines of code:



/* buttons */
    ioctl(uinput->fd, UI_SET_EVBIT, EV_KEY);
    ioctl(uinput->fd, UI_SET_KEYBIT, BTN_LEFT);
    ioctl(uinput->fd, UI_SET_KEYBIT, BTN_MIDDLE);
    ioctl(uinput->fd, UI_SET_KEYBIT, BTN_RIGHT);

    /* wheel */
    ioctl(uinput->fd, UI_SET_EVBIT, EV_REL);
    ioctl(uinput->fd, UI_SET_RELBIT, REL_WHEEL);


I will probably need to declare the additional mouse buttons of my mouse 
(Logitech G403), so I run xev to find some information:



(BTN_LEFT, BTN_RIGHT, button 8, button 9)



ButtonPress event, serial 48, synthetic NO, window 0x301,
    root 0x3ad, subw 0x0, time 361327, (127,94), root:(128,144),
    state 0x0, button 1, same_screen YES

ButtonRelease event, serial 48, synthetic NO, window 0x301,
    root 0x3ad, subw 0x0, time 361426, (127,94), root:(128,144),
    state 0x100, button 1, same_screen YES

ButtonPress event, serial 48, synthetic NO, window 0x301,
    root 0x3ad, subw 0x0, time 362448, (127,94), root:(128,144),
    state 0x0, button 3, same_screen YES

ButtonRelease event, serial 48, synthetic NO, window 0x301,
    root 0x3ad, subw 0x0, time 362556, (127,94), root:(128,144),
    state 0x400, button 3, same_screen YES

ButtonPress event, serial 48, synthetic NO, window 0x301,
    root 0x3ad, subw 0x0, time 366829, (127,94), root:(128,144),
    state 0x0, button 8, same_screen YES

ButtonRelease event, serial 48, synthetic NO, window 0x301,
    root 0x3ad, subw 0x0, time 366949, (127,94), root:(128,144),
    state 0x0, button 8, same_screen YES

ButtonPress event, serial 48, synthetic NO, window 0x301,
    root 0x3ad, subw 0x0, time 368093, (127,94), root:(128,144),
    state 0x0, button 9, same_screen YES

ButtonRelease event, serial 48, synthetic NO, window 0x301,
    root 0x3ad, subw 0x0, time 368250, (127,94), root:(128,144),
    state 0x0, button 9, same_screen YES



Now the next question is obvious: how do I adjust the code to add support for 
button 8,9 ?



I thought BTN_LEFT and BTN_RIGHT would be declared in uinput.h but they are 
global variables? or where are they declared?



Any help with adding support for these buttons would be very appreciated and 
finally make me stop using virtualbox lol.



Thanks!







De : Uri Lublin 
À : br...@netc.fr;
   spice-devel@lists.freedesktop.org
Sujet : Re: [Spice-devel] spice-vdagent: how to enable additional mouse buttons?
Date : 03/05/2020 17:33:55 Europe/Paris

On 5/1/20 3:51 PM, br...@netc.fr wrote:
> 
> I am using spice-vdagent on most of my qemu-kvm vm's, while this is very 
> convenient, mouse button 8 and 9 are not working (those are the side 
> buttons of the mouse, one is often used for BACK function of the 
> browser, which my thumb is actually addicted to).
> How could i make these buttons work with spice-vdagent?

Hi,

Currently 5 mouse buttons are supported. I think some code is needed to 
be added in order to support more buttons.

Uri.

> 
> Thanks for the suggestions,
> 
> Bruts


___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/spice-devel


[Spice-devel] spice-vdagent: how to enable additional mouse buttons?

2020-05-01 Thread bruts

I am using spice-vdagent on most of my qemu-kvm vm's, while this is very 
convenient, mouse button 8 and 9 are not working (those are the side buttons of 
the mouse, one is often used for BACK function of the browser, which my thumb 
is actually addicted to).

How could i make these buttons work with spice-vdagent?



Thanks for the suggestions,



Bruts


___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/spice-devel