Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1221181imu; Thu, 22 Nov 2018 12:19:09 -0800 (PST) X-Google-Smtp-Source: AFSGD/UStK4+BzpIee9v1GB3ut5F4sZr6aw06BQv+beaaam1A1YpBW522/rt1P8ihXcsQ15e+Uwa X-Received: by 2002:a62:de06:: with SMTP id h6mr8776018pfg.158.1542917949744; Thu, 22 Nov 2018 12:19:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542917949; cv=none; d=google.com; s=arc-20160816; b=mLHi+aON5EIt9OZnRethGCeLnQ4H8U4GdhOn9+MwxL7LmR5MgnT5e106Ot8PTKbnEz z4TD/Dyb5h2IhwdSCgFmU1WFTEp/7gr/atSQna3btkU9ArF58qL6lHFGTMp0omWMcyHM /PxkKM7l5Nbh8HMQ0Qbx+2DSP9tIMvKjmLY43eim0H8YNvMuzZLkqtJqz2lq/3wOhfOc FZe9nt7XoDF2olMl9LYkECqHkW3OnuRJ6CJuLGQ/oBaqdBfTALGBM3WYSTrwafNbvRs9 p6J6wdJHu05F0x4gCGDjFpdigbGMTm7r395+c4pYSVxHi6ZJJvt/nAvUG4rtdBDLz8Nu 89wA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:dkim-signature; bh=43Mnox5bB+SkbhDE/lCawN4GL6A3tAvydhv4FyW2C3k=; b=lvb80ra2vzKZX3HU7VUZOg5Pl7HMFrXhLDBQtRer1nO5r0CoYELfPSFBPzaK6hIrPY WNDIuOzKI31l1UJfsP7qTKM0gbH6SaPE1GThMrowN/T985vFIb3rIH35lSnQhcftYOyi MdJckSfXGnNx9MuGm5hbKin6deFe1n6WORf8SM27XGzeoi6bpShEftVzoAd6IKvSsDRM CN6Pp9OztdfWK9BN5OeXHFwB6uzbsHhIjkRtd9awpwXjgQ4BUajJ6Gefe1fRgXDO/Njv j9s2qzM7C0rRK9erMxhx5kaV+iqIqRlUr2/3xRJ6x/Jz8s8hRllBRva9RmowUwIoT7yt HmYA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@who-t.net header.s=fm1 header.b="Je6/lt2H"; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b="t4D/FzN8"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s35si50961734pgk.392.2018.11.22.12.18.37; Thu, 22 Nov 2018 12:19:09 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@who-t.net header.s=fm1 header.b="Je6/lt2H"; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b="t4D/FzN8"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2404715AbeKVRMy (ORCPT + 99 others); Thu, 22 Nov 2018 12:12:54 -0500 Received: from out4-smtp.messagingengine.com ([66.111.4.28]:52187 "EHLO out4-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732955AbeKVRMx (ORCPT ); Thu, 22 Nov 2018 12:12:53 -0500 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id 56EDF221CB; Thu, 22 Nov 2018 01:34:53 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Thu, 22 Nov 2018 01:34:53 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=who-t.net; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm1; bh=43Mnox5bB+Skb hDE/lCawN4GL6A3tAvydhv4FyW2C3k=; b=Je6/lt2HagR5Q+9XTrM2vG2VQeGrK PAub4Z9+iXXZJkKinNBBw/EOS7xCJhX0VkCNcwDFCvvLsaE7zJ8d8R8fRqaMF0CO YV2YGQQM0ROPoN1jhUHuQGLN2yoQD25BaLCG7UtuZppnVZGrywIepcy0ZF2O687r wdwCKFE5guQgkWipDTyisUq95jIrNrL3zhDVAzv47sXubqsRodLel9N8J5cMB8Lc MHCKMSlpBMdfU5igrIMY0zwaooewMwtreLmPzykqq31kVBta6h82jmVyzMBC6AcU 78Si1yGzb0Z7/eVPODW05sYo4S2m51/y7NfGzotJ0ROqQwUua72drdE7A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; bh=43Mnox5bB+SkbhDE/lCawN4GL6A3tAvydhv4FyW2C3k=; b=t4D/FzN8 +fYwczNLmg7mtjWp5xnbnZGaMsd9ctOr462AuxvCuR+6DGlW5FEKTNHpqm1P4SOe ANgVXDQseAGLAkZ61Dw6y5GRio5H6+ruf8iZ4enlYop0ML34QleWRxh5V4rIxnd7 sPOOjQVIlNkjK+iYRenyYk4gk8Wkc2Jdo9ofe/iXISR3n/HJ6aDlYlJPJ3n+7nr1 11oZGY5ZZ5Y2wKoYsCAaFZUJbdUWrjY/vbtT55sbmWifu29w8TqNEuCW43ER+M// KsryzOjcOrZy7RY4Ky+MkYAV4ODrV2k/+hcdLvyKwaY64+ONl61kZntupADRpZ8S XDMDtDimplTDdw== X-ME-Sender: X-ME-Proxy: Received: from jelly.home.gateway (167-179-166-29.a7b3a6.bne.nbn.aussiebb.net [167.179.166.29]) by mail.messagingengine.com (Postfix) with ESMTPA id 6A6BE10304; Thu, 22 Nov 2018 01:34:50 -0500 (EST) From: Peter Hutterer To: linux-input@vger.kernel.org Cc: Dmitry Torokhov , Jiri Kosina , Harry Cutts , torvalds@linux-foundation.org, Nestor Lopez Casado , linux-kernel@vger.kernel.org, Benjamin Tissoires Subject: [PATCH 1/8] Input: add `REL_WHEEL_HI_RES` and `REL_HWHEEL_HI_RES` Date: Thu, 22 Nov 2018 16:34:02 +1000 Message-Id: <20181122063409.15816-2-peter.hutterer@who-t.net> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181122063409.15816-1-peter.hutterer@who-t.net> References: <20181122063409.15816-1-peter.hutterer@who-t.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This event code represents scroll reports from high-resolution wheels and is modelled after the approach Windows uses. The value 120 is one detent (wheel click) of movement. Mice with higher-resolution scrolling can send fractions of 120 to be accumulate in userspace. Userspace can either wait for 120 to accumulate or scroll by fractions of one logical scroll movement as the events come in. For more information see https://docs.microsoft.com/en-us/previous-versions/windows/hardware/design/dn613912(v=vs.85) These new axes obsolete REL_WHEEL and REL_HWHEEL. The legacy axes are emulated but the most accurate (and most granular) data is available through the new axes. Signed-off-by: Peter Hutterer --- Documentation/input/event-codes.rst | 21 ++++++++++++++++++++- include/uapi/linux/input-event-codes.h | 2 ++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/Documentation/input/event-codes.rst b/Documentation/input/event-codes.rst index a8c0873beb95..b24b5343f5eb 100644 --- a/Documentation/input/event-codes.rst +++ b/Documentation/input/event-codes.rst @@ -190,7 +190,26 @@ A few EV_REL codes have special meanings: * REL_WHEEL, REL_HWHEEL: - These codes are used for vertical and horizontal scroll wheels, - respectively. + respectively. The value is the number of detents moved on the wheel, the + physical size of which varies by device. For high-resolution wheels + this may be an approximation based on the high-resolution scroll events, + see REL_WHEEL_HI_RES. These event codes are legacy codes and + REL_WHEEL_HI_RES and REL_HWHEEL_HI_RES should be preferred where + available. + +* REL_WHEEL_HI_RES, REL_HWHEEL_HI_RES: + + - High-resolution scroll wheel data. The accumulated value 120 represents + movement by one detent. For devices that do not provide high-resolution + scrolling, the value is always a multiple of 120. For devices with + high-resolution scrolling, the value may be a fraction of 120. + + If a vertical scroll wheel supports high-resolution scrolling, this code + will be emitted in addition to REL_WHEEL or REL_HWHEEL. The REL_WHEEL + and REL_HWHEEL may be an approximation based on the high-resolution + scroll events. There is no guarantee that the high-resolution data + is a multiple of 120 at the time of an emulated REL_WHEEL or REL_HWHEEL + event. EV_ABS ------ diff --git a/include/uapi/linux/input-event-codes.h b/include/uapi/linux/input-event-codes.h index ae366b87426a..7f14d4a66c28 100644 --- a/include/uapi/linux/input-event-codes.h +++ b/include/uapi/linux/input-event-codes.h @@ -716,6 +716,8 @@ * the situation described above. */ #define REL_RESERVED 0x0a +#define REL_WHEEL_HI_RES 0x0b +#define REL_HWHEEL_HI_RES 0x0c #define REL_MAX 0x0f #define REL_CNT (REL_MAX+1) -- 2.19.1