Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 3 May 2011 09:54:07 -0700
From:      Maksim Yevmenkin <maksim.yevmenkin@gmail.com>
To:        David Demelier <demelier.david@gmail.com>
Cc:        freebsd-bluetooth@freebsd.org
Subject:   Re: Bluetooth mouse does not connect after reboot
Message-ID:  <BANLkTinv1RGDQAs%2BVkHuJOCD6xTthn3hCg@mail.gmail.com>
In-Reply-To: <4DBFA6D0.3010208@gmail.com>
References:  <4D3889D2.80508@gmail.com> <201101202043.p0KKhDIB076736@lurza.secnetix.de> <AANLkTindTyEBAgGV3cBcSs6tGMtN8JtQ3_sHOF4n%2BnEs@mail.gmail.com> <4DBF0D26.8020703@gmail.com> <BANLkTi=dYv5R6jkqNhTj6m%2BZHK=afLXvow@mail.gmail.com> <4DBFA6D0.3010208@gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Hello David,

On Mon, May 2, 2011 at 11:55 PM, David Demelier
<demelier.david@gmail.com> wrote:

[...]

>>> I'm sorry to disturb you again.. I'm still guessin where to search how =
to
>>> get these horizontal events with my bluetooth mouse. I thing the
>>> mouse_info
>>> structure does not need to be extended I have a USB mouse that has the
>>> same
>>> horizontal buttons and they just works !
>>>
>>> They sends 7 and 8 events to X (checked with xev)
>>>
>>> What can I do to extend bthidd and this button support ?
>>
>> like i said before, you need to decode AC_Pan data from the report. i
>> just took a quick look at ums(4) driver and, it appears, that AC_Pan
>> events are translated into button events, i.e. values< =A00 is mask (1
>> << =A03) and values> =A00 is mask (1<< =A04) . you can add identical
>> translation to bthidd(8) to see if it works. you will need to modify
>> hid_interrupt() function in hid.c
>
> Thanks,
>
> I made the following change into hid.c :
>
> markand@Melon ...sr.sbin/bluetooth/bthidd $ diff -ub hid.c.orig hid.c
> --- hid.c.orig =A02011-05-02 22:09:48.000000000 +0200
> +++ hid.c =A0 =A0 =A0 2011-05-03 08:50:45.000000000 +0200
> @@ -168,6 +168,16 @@
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0usage =3D HID_USAGE(h.usage);
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0val =3D hid_get_data(data, &h);
>
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 /* Horizontal buttons */
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (page =3D=3D HUP_CONSUMER && usage =3D=
=3D HUC_AC_PAN) {
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (val =3D=3D -1)
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 mouse_butt =
|=3D (1 << 3);
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 else if (val =3D=3D 1)
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 mouse_butt =
|=3D (1 << 4);

ums(4) has this like

                       if (val < 0)
                               mouse_butt |=3D (1 << 3);
                       else if (val > 0)
                               mouse_butt |=3D (1 << 4);

> +
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 mevents ++;
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 }
> +
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0switch (page) {
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0case HUP_GENERIC_DESKTOP:
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0switch (usage) {
>
> Now xev detect the back / next buttons like my USB one, as Button 6 and 7
> but they do not works in firefox.
>
> I may need to add some flags?

thank you for trying this out. just to confirm, according to xev(1)
wired (usb) and wireless (bluetooth) mice send identical events, is
that correct? if so, does wires (usb) mouse works in firefox?

thanks,
max



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?BANLkTinv1RGDQAs%2BVkHuJOCD6xTthn3hCg>