From owner-freebsd-usb@FreeBSD.ORG Mon Jun 16 15:15:36 2014 Return-Path: Delivered-To: usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 591B46B2 for ; Mon, 16 Jun 2014 15:15:36 +0000 (UTC) Received: from mail-qa0-x22d.google.com (mail-qa0-x22d.google.com [IPv6:2607:f8b0:400d:c00::22d]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 11A962B8F for ; Mon, 16 Jun 2014 15:15:35 +0000 (UTC) Received: by mail-qa0-f45.google.com with SMTP id v10so7589943qac.32 for ; Mon, 16 Jun 2014 08:15:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=fTYpybLwzbxYxP13Von9QtzHixrkjW1H1/DiUYopeN0=; b=JnYTyxHX2xATv0MmAlfhfuL9p9nn3AOhl/Iv0yu/Sokixh382WG18LN12tMgSaBBOf cVbQxB2twUKuXSy0E8my+q9EFmeY65OpghhngTagrnlyyVxYwWW1YCx8hFzo3TzdeZ3u ZoWsr59k/f47HgruG5nT0ntpf/Drl5z8jkUkQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:content-type; bh=fTYpybLwzbxYxP13Von9QtzHixrkjW1H1/DiUYopeN0=; b=DvTcouAKnJsXzktHXUMl+Y0wtbs5lBxIhheqTXiXGDm/Kc56Fv33M1IXx4H8jQhHxC wApvndRhDRBmTTaB2tS2RExLxWwLuIHqszSfMP3SyJL//S9oZBzf+YJhNEMxiU41I9Ce jH1AczKWFSSe1XgbiIquUc2KGosl9nZnFYQKIJDU7bxQjEmxiruwyJMyeg2P6pSlI0oo 4TdORWHq7fzyKI8gwSQH4jGdJ2ajY3Ai7XM3Q0clSECSCCbPk44YvYRQYzxc2+rdzecs ve+S0+0S3yYcu99333h1wgc6wLvKSZ1TWH1ZIHSrGixee3xsC/dWjHB8u/vOvROVz+Ow 7s2w== X-Gm-Message-State: ALoCoQlsfvv8RFij+xMyaRlt/ft5pNFBC4eYHbGqmwjhzHVsyjSTL29mMVTkiosAxo0jNQr9waoI X-Received: by 10.224.92.75 with SMTP id q11mr26820160qam.15.1402931735038; Mon, 16 Jun 2014 08:15:35 -0700 (PDT) MIME-Version: 1.0 Received: by 10.96.222.131 with HTTP; Mon, 16 Jun 2014 08:15:04 -0700 (PDT) In-Reply-To: <539E937F.3070206@selasky.org> References: <539E8C51.30903@selasky.org> <539E8E15.90409@selasky.org> <539E8FBF.2090504@selasky.org> <539E937F.3070206@selasky.org> From: Eitan Adler Date: Mon, 16 Jun 2014 08:15:04 -0700 Message-ID: Subject: Re: weird mouse: acts as keyboard and mouse To: Hans Petter Selasky , "usb@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Jun 2014 15:15:36 -0000 On 15 June 2014 23:49, Hans Petter Selasky wrote: > On 06/16/14 08:39, Eitan Adler wrote: >> >> On 15 June 2014 23:33, Hans Petter Selasky wrote: >>> >>> On 06/16/14 08:30, Eitan Adler wrote: >>>> >>>> >>>> On 15 June 2014 23:26, Hans Petter Selasky wrote: >>>>> >>>>> >>>>> On 06/16/14 08:21, Eitan Adler wrote: >>>>>> >>>>>> >>>>>> >>>>>> On 15 June 2014 23:18, Hans Petter Selasky wrote: >>>>>>> >>>>>>> >>>>>>> >>>>>>> On 06/16/14 08:09, Eitan Adler wrote: >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> Hey Hans, >>>>>>>> >>>>>>>> I have a >>>>>>> 2.00/84.01, addr 12> which is reporting itself as both a mouse and a >>>>>>>> keyboard. I know that the mouse has the ability to remap itself as >>>>>>>> it >>>>>>>> used to not do this (I was able to configure this on a mac). >>>>>>>> >>>>>>>> The annoying effect is that the "back" and "forward" keys now report >>>>>>>> themselves as "[" and "]" keys. >>>>>>>> >>>>>>>> [1645919] ugen0.2: at usbus0 >>>>>>>> [1645919] ums0: >>>>>>> 2.00/84.01, addr 12> on usbus0 >>>>>>>> [1645919] ums0: 16 buttons and [XYZT] coordinates ID=0 >>>>>>>> [1645919] ukbd0: >>>>>>> 2.00/84.01, addr 12> on usbus0 >>>>>>>> [1645919] kbd2 at ukbd0 >>>>>>>> >>>>>>>> I think it would be a good idea to write a utility to configure this >>>>>>>> stuff on FreeBSD. What information do I need to obtain / how should >>>>>>>> I >>>>>>>> obtain it? I'm guessing its possible to talk to the mouse over USB >>>>>>>> but I'm not sure how. >>>>>>>> >>>>>>>> >>>>>>> >>>>>>> Hi, >>>>>>> >>>>>>> Can you check the configuration descriptor first? >>>>>>> >>>>>>> usbconfig -d X.Y dump_device_desc dump_curr_config_desc >>>>>>> >>>>>>> Possibly you need to issue some HID command (set report descriptor) >>>>>>> to >>>>>>> make >>>>>>> the device change behaviour. >>>>>>> >>>>>>> --HPS >>>>>> >>>>>> >>>>>> >>>>>> >>>>> >>>>> Hi, >>>>> >>>>> USB descriptors look sane. >>>>> >>>>> Add: >>>>> >>>>> usbconfig -d X.Y add_quirk UQ_KBD_IGNORE >>>>> usbconfig -d X.Y add_quirk UQ_UMS_IGNORE >>>>> >>>>> Then re-plug the device. >>>>> >>>>> Now you should have /dev/uhidX >>>>> >>>>> Run: >>>>> >>>>> usbhidctl -f /dev/uhidX -rvx >>>>> >>>>> For both uhid devices. >>>>> >>>>> Thank you! >>>>> >>>>> --HPS >>>>> >>>>> >>>> >>>> [10054 root@gravity .../eitan/svn/fbsd/ports !2!]#usbhidctl -f >>>> /dev/uhid0 -rvx >>>> (svn:ports)-[head:357806] >>>> Report descriptor: >>>> Collection type=Application page=Generic_Desktop usage=Mouse >>>> Collection type=Physical page=Generic_Desktop usage=Pointer >>>> Input rid=0 size=1 count=1 page=Button usage=Button_1, logical range >>>> 0..1 >>>> Input rid=0 size=1 count=1 page=Button usage=Button_2, logical range >>>> 0..1 >>>> Input rid=0 size=1 count=1 page=Button usage=Button_3, logical range >>>> 0..1 >>>> Input rid=0 size=1 count=1 page=Button usage=Button_4, logical range >>>> 0..1 >>>> Input rid=0 size=1 count=1 page=Button usage=Button_5, logical range >>>> 0..1 >>>> Input rid=0 size=1 count=1 page=Button usage=Button_6, logical range >>>> 0..1 >>>> Input rid=0 size=1 count=1 page=Button usage=Button_7, logical range >>>> 0..1 >>>> Input rid=0 size=1 count=1 page=Button usage=Button_8, logical range >>>> 0..1 >>>> Input rid=0 size=1 count=1 page=Button usage=Button_9, logical range >>>> 0..1 >>>> Input rid=0 size=1 count=1 page=Button usage=Button_10, logical range >>>> 0..1 >>>> Input rid=0 size=1 count=1 page=Button usage=Button_11, logical range >>>> 0..1 >>>> Input rid=0 size=1 count=1 page=Button usage=Button_12, logical range >>>> 0..1 >>>> Input rid=0 size=1 count=1 page=Button usage=Button_13, logical range >>>> 0..1 >>>> Input rid=0 size=1 count=1 page=Button usage=Button_14, logical range >>>> 0..1 >>>> Input rid=0 size=1 count=1 page=Button usage=Button_15, logical range >>>> 0..1 >>>> Input rid=0 size=1 count=1 page=Button usage=Button_16, logical range >>>> 0..1 >>>> Input rid=0 size=16 count=1 page=Generic_Desktop usage=X, logical >>>> range -32767..32767 >>>> Input rid=0 size=16 count=1 page=Generic_Desktop usage=Y, logical >>>> range -32767..32767 >>>> Input rid=0 size=8 count=1 page=Generic_Desktop usage=Wheel, logical >>>> range -127..127 >>>> Input rid=0 size=8 count=1 page=Consumer usage=AC_Pan, logical range >>>> -127..127 >>>> End collection >>>> End collection >>>> Total input size 8 bytes >>>> Total output size 0 bytes >>>> Total feature size 0 bytes >>>> [10055 root@gravity /home/eitan/svn/fbsd/ports ]#usbhidctl -f >>>> /dev/uhid1 -rvx >>>> 41s (svn:ports)-[head:357806] >>>> Report descriptor: >>>> Collection type=Application page=Generic_Desktop usage=Keyboard >>>> Input rid=1 size=1 count=1 page=Keyboard usage=Keyboard_LeftControl, >>>> logical range 0..1 >>>> Input rid=1 size=1 count=1 page=Keyboard usage=Keyboard_LeftShift, >>>> logical range 0..1 >>>> Input rid=1 size=1 count=1 page=Keyboard usage=Keyboard_LeftAlt, >>>> logical range 0..1 >>>> Input rid=1 size=1 count=1 page=Keyboard usage=Keyboard_Left_GUI, >>>> logical range 0..1 >>>> Input rid=1 size=1 count=1 page=Keyboard >>>> usage=Keyboard_RightControl, logical range 0..1 >>>> Input rid=1 size=1 count=1 page=Keyboard usage=Keyboard_RightShift, >>>> logical range 0..1 >>>> Input rid=1 size=1 count=1 page=Keyboard usage=Keyboard_RightAlt, >>>> logical range 0..1 >>>> Input rid=1 size=1 count=1 page=Keyboard usage=Keyboard_Right_GUI, >>>> logical range 0..1 >>>> Input rid=1 size=8 count=5 page=Keyboard >>>> usage=Reserved_(no_event_indicated) Array, logical range 0..164 >>>> End collection >>>> Collection type=Application page=Consumer usage=Consumer_Control >>>> Input rid=3 size=16 count=2 page=Consumer usage=Consumer_Control >>>> Array, logical range 1..652 >>>> End collection >>>> Collection type=Application page=Microsoft usage=0x0001 >>>> Input rid=16 size=8 count=6 page=Microsoft usage=0x0001 Array, >>>> logical range 0..255 >>>> Output rid=16 size=8 count=6 page=Microsoft usage=0x0001 Array, >>>> logical range 0..255 >>>> End collection >>>> Collection type=Application page=Microsoft usage=0x0002 >>>> Input rid=17 size=8 count=19 page=Microsoft usage=0x0002 Array, >>>> logical range 0..255 >>>> Output rid=17 size=8 count=19 page=Microsoft usage=0x0002 Array, >>>> logical range 0..255 >>>> End collection >>>> Total input size 20 bytes >>>> Total output size 20 bytes >>>> Total feature size 0 bytes >>>> >>>> >>> >>> Hi, >>> >>> Looks like a real keyboard. If you add a quirk to hide the keyboard, does >>> the mouse function like it should? >> >> >> If I remove the IGNORE_UMS quirk then the mouse works as normal until >> I try to press the 'back' or 'forward' keys then the entire mouse >> freezes: not even moment or normal mouse keys work >> > > I guess that's because this mouse does not have very intelligent firmware > :-) > > Try reading from the HID device which corresponds to the keyboard: > > dd if=/dev/uhid0 of=/dev/null bs=20 & > > bs= must be correct. > > Does that help? Yes it does: although the back/forward keys still don't work. -- Eitan Adler