From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53736) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aqcJ7-00084L-UP for qemu-devel@nongnu.org; Thu, 14 Apr 2016 04:07:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aqcJ3-0004WA-Tw for qemu-devel@nongnu.org; Thu, 14 Apr 2016 04:07:21 -0400 Received: from mx1.redhat.com ([209.132.183.28]:57985) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aqcJ3-0004Vm-Oh for qemu-devel@nongnu.org; Thu, 14 Apr 2016 04:07:17 -0400 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4B8FF2027E for ; Thu, 14 Apr 2016 08:07:17 +0000 (UTC) Message-ID: <1460621235.13389.8.camel@redhat.com> From: Gerd Hoffmann Date: Thu, 14 Apr 2016 10:07:15 +0200 In-Reply-To: References: <1460562303-17079-1-git-send-email-kraxel@redhat.com> <1460562303-17079-9-git-send-email-kraxel@redhat.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 Subject: Re: [Qemu-devel] [PULL v2 8/9] input-linux: refine mouse detection List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Ladi Prosek Cc: qemu-devel@nongnu.org On Do, 2016-04-14 at 09:42 +0200, Ladi Prosek wrote: > On Wed, Apr 13, 2016 at 5:45 PM, Gerd Hoffmann wrote: > > Read absolute and relative axis information, only classify > > devices as mouse/tablet in case the x axis is present. >=20 > I, too, had to come up with a heuristic to classify input devices in > my guest driver and what I ended up with is different. >=20 > For example my Dell keyboard has two endpoints, one with a bunch of > keys and LEDs, so it would be classified as a keyboard. The second one > with special keys (KEY_MUTE, KEY_WWW, KEY_BACK, ..) *and* with a mouse > (REL_X, REL_Y, REL_WHEEL, BTN_LEFT, ...). The reason for this are the > zoom in/out buttons. Pressing them generates Ctrl down on the first > endpoint and mouse wheel up/down on the second one. Releasing them > then translates to Ctrl up. Crazy. So they are building os-specific hotkeys into the hardware. Crazy indeed. It's not obvious though why the second function has keyboard keys. Possibly they want the first function look like a pretty standard keyboard without any extra fluff, to sidestep compatibility issues with old software not expecting that. > So I wouldn't use exclusive OR when classifying because there are > combo devices out there. Maybe anything with an EV_KEY (minus BTN_*) > would be a keyboard? Right now each device type has its own callback function, we have to reorganize that to support a device being classified as both mouse and keyboard. Worth considering, but not 2.6 material. There surely is more room for improvements, not only in input-linux but in the input system in general and in the virtual input devices, for example to support all those extra keys on multimedia keyboards. cheers, Gerd