From owner-freebsd-usb@FreeBSD.ORG Tue Jun 17 01:00:07 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 8B5A8C77 for ; Tue, 17 Jun 2014 01:00:07 +0000 (UTC) Received: from mail-qc0-x233.google.com (mail-qc0-x233.google.com [IPv6:2607:f8b0:400d:c01::233]) (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 429B7214B for ; Tue, 17 Jun 2014 01:00:07 +0000 (UTC) Received: by mail-qc0-f179.google.com with SMTP id x3so7922888qcv.10 for ; Mon, 16 Jun 2014 18:00:06 -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 :cc:content-type; bh=1H3oufzGQJ7ZfgI16ugWDXtTl4IZmocJbPz0cKGp1oE=; b=P8dKCrbsTfoUbXMLUv+SHyZuKLmn77gB5G8IZv+iC0Q3VYAjr5UtotwQHmBXbU6E1H WSw6zHLpV2fbQoh5JewqH58E1aAG7VuPrP6ukoDzba3tEDxNYOBglG3Sah0fVmLSWclB MUhaf9QAdWmKI9nnT+LtrMArJBQf351HB4/cA= 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:cc:content-type; bh=1H3oufzGQJ7ZfgI16ugWDXtTl4IZmocJbPz0cKGp1oE=; b=HGExY6OlQwkws/n87HiEqUFvRNWScT84SMsPJt36t0NnaOuXUxsw3RI9/+Z8QabfSK HpjXNMrp71aD+82rcUVImZQv7kQsj6+K/Mw19P6ZFOQiItS8CdXy6LYw5SNHrr6JOJp7 b7KFF4z9uSGB29LOmRvirxDwVX4CNOuSQlbBfQmpWIrurEQSuhhViEnLwKfZ6qPGEomx xyu4GfF42wpDRCGm7UBVNPjRbNG9Xt7gzlFor7LH+kBDq27ojQ9iL9jYeqi22/CVUwGM HQMjfGB1bwhOTC/8GSh1EtXcFAeB2go0aCxecmSSzXIR8RYiy2I1yGtBLeCUMq+KvdI/ TnAA== X-Gm-Message-State: ALoCoQkov47+xsywKqRn86ZVL+2len8ZFHdz8R53l77Q2XVTEL3Jzg7e16xBtPVPTa281XjotjQV X-Received: by 10.224.135.132 with SMTP id n4mr33026947qat.23.1402966806380; Mon, 16 Jun 2014 18:00:06 -0700 (PDT) MIME-Version: 1.0 Received: by 10.96.222.131 with HTTP; Mon, 16 Jun 2014 17:59:35 -0700 (PDT) In-Reply-To: <539F0E00.6090503@selasky.org> References: <539E8C51.30903@selasky.org> <539E8E15.90409@selasky.org> <539E8FBF.2090504@selasky.org> <539E937F.3070206@selasky.org> <539F0E00.6090503@selasky.org> From: Eitan Adler Date: Mon, 16 Jun 2014 17:59:35 -0700 Message-ID: Subject: Re: weird mouse: acts as keyboard and mouse To: Hans Petter Selasky Content-Type: text/plain; charset=UTF-8 Cc: "usb@freebsd.org" 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: Tue, 17 Jun 2014 01:00:07 -0000 On 16 June 2014 08:32, Hans Petter Selasky wrote: > On 06/16/14 17:15, Eitan Adler wrote: >> >> 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: >>>>>>>>> rev >>>>>>>>>> 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. >> > > Hi, > > I'm unsure what to do next. The USB firmware makers are simply getting more > and more creative :-) The surely didn't ask me if doing a USB mouse that way > would be clever :-) It appears the mac utility can cause the mouse to enter different modes. I'm curious if there is any usb sniffer I can use for OSX to see what commands it sends to the mouse. > Have you checked if "uhidd" might work better with your device? I havn't tried this, but will do so when I can -- Eitan Adler