From owner-freebsd-usb@FreeBSD.ORG Thu May 8 08:56:32 2008 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4A3D3106564A for ; Thu, 8 May 2008 08:56:32 +0000 (UTC) (envelope-from alexander@leidinger.net) Received: from redbull.bpaserver.net (redbullneu.bpaserver.net [213.198.78.217]) by mx1.freebsd.org (Postfix) with ESMTP id BA8F88FC1A for ; Thu, 8 May 2008 08:56:31 +0000 (UTC) (envelope-from alexander@leidinger.net) Received: from outgoing.leidinger.net (p54A550B9.dip.t-dialin.net [84.165.80.185]) by redbull.bpaserver.net (Postfix) with ESMTP id A3A082E160 for ; Thu, 8 May 2008 10:36:41 +0200 (CEST) Received: from deskjail (unknown [192.168.1.109]) by outgoing.leidinger.net (Postfix) with ESMTP id 1AD9D103EAB for ; Thu, 8 May 2008 10:36:37 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=Leidinger.net; s=outgoing-alex; t=1210235798; bh=HH5CqaYKZxC2mCU6ZxGJmBUfiIgNxOiDT IX2bsvJOpw=; h=Date:From:To:Subject:Message-ID:In-Reply-To: References:Mime-Version:Content-Type:Content-Transfer-Encoding; b=fjMM8Oyk4wC022edqMQnWSqpLGWxGOcdv8l3I0h1kDRdhEirROtwU80DIUou7ctTr FGlrc8YyNfvlgHDwT/pPaw8tcu4/XTTaWm7x2SvPst2AcAs/4c6WGLnlazvW1pKQehT wyNFqv/nEPCRP9uDVwTEDXjX86ZSfsRn7uh4tvMC3BpkgyHGgKYD/Y/uMclW7f5/qYh ejdwGcXQrlzXO9+65/UpTyocMmjsYWkCARaO5PRVsqScbzopzVAcLjSktXSuEd77GZe kZreZXiVv3Qp5oZbHV+LkjZoC9SFMjPf2xoQhGfJ7dfdbM+BYCTJve3ONa0uNXr0Fjd d4Wfp7/BQ== Date: Thu, 8 May 2008 10:36:36 +0200 From: Alexander Leidinger To: freebsd-usb@freebsd.org Message-ID: <20080508103636.153b1576@deskjail> In-Reply-To: <20080507192420.694f57ee@deskjail> References: <20080507192420.694f57ee@deskjail> X-Mailer: Claws Mail 3.3.1 (GTK+ 2.12.8; i686-portbld-freebsd8.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BPAnet-MailScanner-Information: Please contact the ISP for more information X-BPAnet-MailScanner: Found to be clean X-BPAnet-MailScanner-SpamCheck: not spam, ORDB-RBL, SpamAssassin (not cached, score=-13.244, required 6, BAYES_00 -15.00, DKIM_SIGNED 0.00, DKIM_VERIFIED -0.00, J_BACKHAIR_24 1.00, NO_RDNS 0.50, RDNS_DYNAMIC 0.10, SUBJECT_FUZZY_TION 0.16) X-BPAnet-MailScanner-From: alexander@leidinger.net X-Spam-Status: No Subject: How to remap or ignore certain mouse buttons? (was: Fun with Logitech keyboard/mouse kombo (diNovo Edge)...) X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 May 2008 08:56:32 -0000 Quoting Alexander Leidinger (Wed, 7 May 2008 19:24:20 +0200): > Hi, > > I bought a keyboard with an integrated touchpad from logitech. Just > plugging in the BT-dongle gives an usb hub with ums and ukbd. > Unfortunately the ums doesn't work. When I start moused with > "-p /dev/ums0 -3 -f -d" I get no output when I press the buttons or > touch the touchpad. Any hints how to debug this problem? usbhidctl > doesn't print anything useful (but I don't know if it is ok to use it > with /dev/ums0). After a little bit of googling I found a description of the problem with the diNovo Edge. Quoting from http://www.mail-archive.com/linux-usb-users@lists.sourceforge.net/msg17777.html ---snip--- Mouse device shows multiple reports with the same usage, which makes hid-input.c remap those instances of this usage to different events. As a result, the actual GenericDesktop.X and .Y usages end up mapped to .Z and .RX events, which prevents the mouse from working. --- a/drivers/usb/input/hid-input.c 2006-12-11 11:32:53.000000000 -0800 +++ b/drivers/usb/input/hid-input.c 2006-12-26 17:18:46.000000000 -0800 @@ -583,8 +583,11 @@ static void hidinput_configure_usage(str set_bit(usage->type, input->evbit); - while (usage->code <= max && test_and_set_bit(usage->code, bit)) - usage->code = find_next_zero_bit(bit, max + 1, usage->code); + if(device->quirks & HID_QUIRK_NO_USAGE_UNIQUIFY) + set_bit(usage->code, bit); + else + while (usage->code <= max && test_and_set_bit(usage->code, bit)) + usage->code = find_next_zero_bit(bit, max + 1, ---snip--- The git repository (as indexed by fxr.watson.org) shows a different fix. In the linux hid-input.c they have this: ---snip--- 409 case HID_UP_BUTTON: 410 411 code = ((usage->hid - 1) & 0xf); 412 413 switch (field->application) { 414 case HID_GD_MOUSE: 415 case HID_GD_POINTER: code += 0x110; break; 416 case HID_GD_JOYSTICK: code += 0x120; break; 417 case HID_GD_GAMEPAD: code += 0x130; break; 418 default: 419 switch (field->physical) { 420 case HID_GD_MOUSE: 421 case HID_GD_POINTER: code += 0x110; break; 422 case HID_GD_JOYSTICK: code += 0x120; break; 423 case HID_GD_GAMEPAD: code += 0x130; break; 424 default: code += 0x100; 425 } 426 } 427 428 /* Special handling for Logitech Cordless Desktop */ 429 if (field->application != HID_GD_MOUSE) { 430 if (device->quirks & HID_QUIRK_LOGITECH_EXPANDED_KEYMAP) { 431 int hid = usage->hid & HID_USAGE; 432 if (hid < LOGITECH_EXPANDED_KEYMAP_SIZE && logitech_expanded_keymap[hid] != 0) 433 code = logitech_expanded_keymap[hid]; 434 } 435 } else { 436 if (device->quirks & HID_QUIRK_LOGITECH_IGNORE_DOUBLED_WHEEL) { 437 int hid = usage->hid & HID_USAGE; 438 if (hid == 7 || hid == 8) 439 goto ignore; 440 } 441 } 442 443 map_key(code); 444 break; ---snip--- As we see there, they think the wheel is incorrectly doubled (HID_QUIRK_LOGITECH_IGNORE_DOUBLED_WHEEL). I'm not really sure if the wheel is realy doubled. The touchwheel on the keyboard is supposed to have a mouse area in the inside, and on the upper and right edge, there are areas which are supposed to be able to move the scrollbars in windows (left<->right + up<->down). So I think there are maybe 2 wheels (in one physical one). I tried to use both parts of the touchwheel, but nothing works, so for the moment I search for a way to do the same what linux does. How can I do the same thing in FreeBSD what Linux does? Later I would be interested to get the additional parts working. Any hints how to do this are welcome. Bye, Alexander. -- Leela: Hey, you know what might be a hoot? Professor: No. Why would I know that? http://www.Leidinger.net Alexander @ Leidinger.net: PGP ID = B0063FE7 http://www.FreeBSD.org netchild @ FreeBSD.org : PGP ID = 72077137