Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp8903646imu; Tue, 4 Dec 2018 16:45:18 -0800 (PST) X-Google-Smtp-Source: AFSGD/UHvVDo3Wk3nY7Y6aUwM5L8WYMU/XGzJkdc4FF2kAJdpBR1OENXBgHW7E38pirEOpzONFSO X-Received: by 2002:a17:902:b68d:: with SMTP id c13mr22187198pls.102.1543970718780; Tue, 04 Dec 2018 16:45:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543970718; cv=none; d=google.com; s=arc-20160816; b=rLVoP3+gG5o2WyE3Ljv4qEzf+pNc2rYBtYPhb0DE414NqrixJAeeDZXnAaBFzCV1aG 95bTpwAFuQJhkKoR8o0OVCu3gBR0DAnzcobgAEFU69wB7Rp4suUpQCP71ZMSfeClGJ2E 7U44+G0aEcSg95q10BuYVkHn5ljPqBJPVdmYUFzTBwJ3a6byXpIb5VXefk98emeBdm7u TErlrPjtLnDAtcXA/bzk7lvfjRzfjAi53M0PpW1Rdnixsc0X88y3AnPXetzVwkTv2RJo uESlN9lJY6QTt0/K9j5ScQL6BpAJBvGmithX5X1mbNuKy460+H1GHtu52OlUdhy9JCGZ aw0A== 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=f6T5afCfbSIx/IZSw2eDCVOPTs4vfPtmyp4UlGxir3g=; b=boQrQDvok1iSxTy6nYNDm7J2wXsmSv5FH7Hg5e1Ka8iHbUOf+GmAy6QdjIZRnbY+7P +aru1Wzpp5qUm3E5XE/3Tn8mKoOQcpzn/roKVkhyeiC27ZzH2HWupKZPWaUTLLeUR4dP wgQzBw/vmkD2fw2hvGMtWMaYgYIFgvhN0uuzgVUuYTxdVoMRxdTBJOUpxQGXVrGzQjYB jhRNyK5frTom3RksVpQjsFV2SEVsXKtQk/V4VMSI6nvALzHa7RJYRbQq5SvXAbGi2/Hr l3j5NP6CXp8tQugouz/fGktN+0VjYFCGvkK6rmx625pBZukr+pxUsRInOodY/wsEHlpx sF3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@who-t.net header.s=fm1 header.b=GgrYvSUS; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=bytmm5Dh; 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 p16si18501388plr.31.2018.12.04.16.45.03; Tue, 04 Dec 2018 16:45:18 -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=GgrYvSUS; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=bytmm5Dh; 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 S1726695AbeLEAm4 (ORCPT + 99 others); Tue, 4 Dec 2018 19:42:56 -0500 Received: from wout2-smtp.messagingengine.com ([64.147.123.25]:43921 "EHLO wout2-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725904AbeLEAmy (ORCPT ); Tue, 4 Dec 2018 19:42:54 -0500 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.west.internal (Postfix) with ESMTP id 7F575F52; Tue, 4 Dec 2018 19:42:52 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Tue, 04 Dec 2018 19:42: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=f6T5afCfbSIx/ IZSw2eDCVOPTs4vfPtmyp4UlGxir3g=; b=GgrYvSUSV1D6R2TasBIju2SRun1Yi IZFvoIOcvoOKF+4iFedP5XoyUyvVUMT+LD3KXh+kSTWZRNw7b7updcVtKFxlNoXt EnBVuOmIOfZRFaMmU44MJtxhdyTy8yDJKbXGu2XHe7FPtgeHtTnMXlsz08X7rd38 aUgF4EvklF43Cfx7Jhe7wXSfkmrbLH/ANXfX8+hJQcg9J/wX+Vwb+lxqSEW20KOi uGpRx44R0IFh3QqHXbsY33n/hxi5n5mEprEPfL1UqdNpkajSi2cKxslrMFg3GxFH A4oR+BtQPpkeX4ZTMnDQCCimZd1LMDRGBpoVDHGS6eMYkeRNtI/j4v3Zg== 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=f6T5afCfbSIx/IZSw2eDCVOPTs4vfPtmyp4UlGxir3g=; b=bytmm5Dh pkmwfpjMIsTP2EOMNc7U/IaZQY2Ff71fpAstvQDLx8z985x8kSE/kPk54a6yuJCx HOk6tJvrUd/RAqhCGnt0HWI+mYFwPooUg+kyXMLGBFAeGUpIaCQVXJOT6ofV5TcP etmCX2YI7q54IQqoSZ72uD6PHNtjMmyYnNlm0TzQbERVUKmQ7nvONzgBoDp+muGx 5FVmZhFJ+gtGTySe38dQEE8uTlqf2fuEUowi4hZZYDHkB+nui+KhEziUT66uBlP3 kx51zxp2K84bLCYldPfaIJtPwSHmRsUmpB8ru2FPH9m2tEnaTEqIT58lHaHxON07 KD5vVs4568vkNg== 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 42F0FE48FA; Tue, 4 Dec 2018 19:42:49 -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 v3 1/8] Input: add `REL_WHEEL_HI_RES` and `REL_HWHEEL_HI_RES` Date: Wed, 5 Dec 2018 10:42:21 +1000 Message-Id: <20181205004228.10714-2-peter.hutterer@who-t.net> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20181205004228.10714-1-peter.hutterer@who-t.net> References: <20181205004228.10714-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 which must be accumulated in userspace. Userspace can either wait for a full 120 to accumulate or scroll by fractions of one logical scroll movement as the events come in. 120 was picked as magic number because it has a high number of integer fractions that can be used by high-resolution wheels. 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 by the kernel but the most accurate (and most granular) data is available through the new axes. Signed-off-by: Peter Hutterer --- No changes since v1 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 3eb5a4c3d60a..265ef2028660 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.2