From owner-freebsd-bluetooth@FreeBSD.ORG Tue May 3 19:09:40 2011 Return-Path: Delivered-To: freebsd-bluetooth@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1C616106566B for ; Tue, 3 May 2011 19:09:40 +0000 (UTC) (envelope-from maksim.yevmenkin@gmail.com) Received: from mail-bw0-f54.google.com (mail-bw0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id 983218FC08 for ; Tue, 3 May 2011 19:09:39 +0000 (UTC) Received: by bwz12 with SMTP id 12so546044bwz.13 for ; Tue, 03 May 2011 12:09:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=YHIcyveEZmxHiYD0MA6rfmxmy2btwv1H4kJxkcWxB0o=; b=op2zc4Cj5/Jdvzw9KqF0+CYr00t6Gggof4IohRbWMF/oRET08mMpq1TT3JFdjzUcW0 L2P5OPXOiuDYGmmI1qgPqgJjvwTUUl6fY0441joZ4NuqxYMBR5x5ywYv2RAQMqYXXhVI lnZgT2a7HallUfJ8VBOr9G4QDbVDq2PkbxyQ4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=MEFboCD2r8DCqPTlDJRtBkMcOHsNe3CFOuuLTEeHe5igInYHVwGBcY60NyaIQ1cuDF TtDERDP9woOkkg1Z4ju0uJxLtVAyOUrIV/71G6Ju38r7cxj3zG2lWp5QmKCmGMuKGJcc 4y3zwRQ2wBiHoN2nRfb3QvIk9p1xKegDPmipw= MIME-Version: 1.0 Received: by 10.204.16.72 with SMTP id n8mr207017bka.8.1304449778299; Tue, 03 May 2011 12:09:38 -0700 (PDT) Received: by 10.204.39.133 with HTTP; Tue, 3 May 2011 12:09:38 -0700 (PDT) In-Reply-To: <4DC04F31.6050405@gmail.com> References: <4D3889D2.80508@gmail.com> <201101202043.p0KKhDIB076736@lurza.secnetix.de> <4DBF0D26.8020703@gmail.com> <4DBFA6D0.3010208@gmail.com> <4DC04F31.6050405@gmail.com> Date: Tue, 3 May 2011 12:09:38 -0700 Message-ID: From: Maksim Yevmenkin To: David Demelier Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: freebsd-bluetooth@freebsd.org Subject: Re: Bluetooth mouse does not connect after reboot X-BeenThere: freebsd-bluetooth@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Using Bluetooth in FreeBSD environments List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 May 2011 19:09:40 -0000 On Tue, May 3, 2011 at 11:53 AM, David Demelier wrote: > On 03/05/2011 18:54, Maksim Yevmenkin wrote: >> >> Hello David, >> >> On Mon, May 2, 2011 at 11:55 PM, David Demelier >> =A0wrote: >> >> [...] >> >>>>> I'm sorry to disturb you again.. I'm still guessin where to search ho= w >>>>> 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 th= e >>>>> 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< =A0 =A00 is mas= k (1 >>>> << =A0 =A03) and values> =A0 =A00 is mask (1<< =A0 =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&& =A0usage = =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_but= t |=3D (1<< =A03); >>> + =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_but= t |=3D (1<< =A04); >> >> ums(4) has this like >> >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if (val< =A00) >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0mouse_but= t |=3D (1<< =A03); >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0else if (val> =A00) >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0mouse_but= t |=3D (1<< =A04); >> >>> + >>> + =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? > > 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 ? > > =A0467 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 if ((flags & MOUSE_FLAGS_MASK) =3D= =3D MOUSE_FLAGS) > =A0468 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 info->sc_flags |= =3D UMS_FLAG_T_AXIS; > > I'm guessing why the buttons are recognized as 6 and 7 by xev, we are usi= ng > 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