From owner-freebsd-usb@FreeBSD.ORG Fri Jun 20 03:43:37 2014 Return-Path: Delivered-To: usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 223F5E4E for ; Fri, 20 Jun 2014 03:43:37 +0000 (UTC) Received: from mail-qa0-x233.google.com (mail-qa0-x233.google.com [IPv6:2607:f8b0:400d:c00::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 C75F82CAE for ; Fri, 20 Jun 2014 03:43:36 +0000 (UTC) Received: by mail-qa0-f51.google.com with SMTP id j7so2713759qaq.24 for ; Thu, 19 Jun 2014 20:43: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 :cc:content-type; bh=85iOAE945CW5/FXF5wYDSm6dQiugVnEMjszulxka6YY=; b=QqVpcTmgNN1XNXqPxWVF5u0ZGfs7CpuLV6g6vDUI+9177xoonLDkx8eocFPb5RIbs0 FU2+S/4slKe/Wjm7zBqhZkiRgOE0hdO/yGllDd26f4J7CTCSuWOG7v8NTbCqO568KJkJ LuetI7PWR84xcILrviTmUa7WQgMJdICO0kvpk= 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=85iOAE945CW5/FXF5wYDSm6dQiugVnEMjszulxka6YY=; b=T6R6mVv2Fd2m+SlWRkRiGtn5WMMXAp7SSBs6Jb36o7z4GMAsitMV24vPbKgjpO6xy7 YTXRJI64fzuZrcmJLg3lrHY+4uhOurWMv4beoAW4XNfKM3gdkE+ep3W7oxIPZTK+ZiD8 hhAqkydRoDZnyjw/F1semfyd6NCIZrN1zV59W+MJa52HkYO3h3pQ0HJRjLEFOaNSET+T fGvcjOd+sAQi1gYSNtkRfCesxgpqcNib9YCG+9pxdSULigJ69hTzo5IzqWg3Us2G2Ys+ GETkQHrZB7GsRc0ilvNSf7swIEwxRiW1D+CSgTAGb+hBvceXzMlCSXjrsP+gWwZsLu3Y HUtQ== X-Gm-Message-State: ALoCoQmm4PXDTJ8bBtv3BThh3bNvPQWCie4qNDKpWPF6+BN2LkzIy7gs4cbyHa6zyCay8yBOojWz X-Received: by 10.140.47.245 with SMTP id m108mr898897qga.9.1403235815672; Thu, 19 Jun 2014 20:43:35 -0700 (PDT) MIME-Version: 1.0 Received: by 10.96.222.131 with HTTP; Thu, 19 Jun 2014 20:43:05 -0700 (PDT) In-Reply-To: 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: Thu, 19 Jun 2014 20:43:05 -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: Fri, 20 Jun 2014 03:43:37 -0000 On 16 June 2014 17:59, Eitan Adler wrote: > 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 Any suggestions for ways to talk to the mouse? I could try brute forcing configuration options: Its shameful if we need to use a mac to fix these sorts of problems. -- Eitan Adler