On Tue, May 3, 2011 at 11:53 AM, David Demelier <[email protected]> wrote: > On 03/05/2011 18:54, Maksim Yevmenkin wrote: >> >> Hello David, >> >> On Mon, May 2, 2011 at 11:55 PM, David Demelier >> <[email protected]> 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< 0 is mask (1 >>>> << 3) and values> 0 is mask (1<< 4) . 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 2011-05-02 22:09:48.000000000 +0200 >>> +++ hid.c 2011-05-03 08:50:45.000000000 +0200 >>> @@ -168,6 +168,16 @@ >>> usage = HID_USAGE(h.usage); >>> val = hid_get_data(data,&h); >>> >>> + /* Horizontal buttons */ >>> + if (page == HUP_CONSUMER&& usage == HUC_AC_PAN) { >>> + if (val == -1) >>> + mouse_butt |= (1<< 3); >>> + else if (val == 1) >>> + mouse_butt |= (1<< 4); >> >> ums(4) has this like >> >> if (val< 0) >> mouse_butt |= (1<< 3); >> else if (val> 0) >> mouse_butt |= (1<< 4); >> >>> + >>> + mevents ++; >>> + } >>> + >>> switch (page) { >>> case HUP_GENERIC_DESKTOP: >>> switch (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? > > In fact I just realized that my usb mouse sends button 8 and 9, but if I saw > well ums also set a UMS_FLAG_T_AXIS and the following may be needed ? > > 467 if ((flags & MOUSE_FLAGS_MASK) == MOUSE_FLAGS) > 468 info->sc_flags |= UMS_FLAG_T_AXIS; > > I'm guessing why the buttons are recognized as 6 and 7 by xev, we are using > the same mask (1 << 3) and (1 << 4) as ums.
well, in this case, can you please try to change the mask to be (1 << 5) and (1 << 6)? thanks, max _______________________________________________ [email protected] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-bluetooth To unsubscribe, send any mail to "[email protected]"
