From nobody Fri Mar 7 17:55:21 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z8Ypx4H3sz5pvCS; Fri, 07 Mar 2025 17:55:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z8Ypx2Ktrz3Y3X; Fri, 07 Mar 2025 17:55:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741370121; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fMTAJpSV6wmabkYiP8T2QflFpuJI+DNHkoVfqS5DDNM=; b=dS29N/6OZTD3pKXAcckBJJY1j1pFdk2yqtZNrQ86e5jM6c9C69AxPZ7GfWuMsoROCbfaY7 17KdxO3xL35XFIxDRPZg7UxzKQmG9eET5DqSvCDjd6/wOxODtTZTZyQsvtC2iYFyOuaPVi YXlwZA4dvO8Yvbc788J0Cp4Bknd1+OsiJMI/3F4nuJj43zHOQbJ68GjkDdpyZevzLkreYL /KSEkKhRzbCkWWG7UzaAZ102XZ1p6AQ8/pZK0JUSCnKeylJ44gsERV1LmBf4nWKvg76Azt DtYgpOqdCywKxvft8Pt0Ww4qrXz4kwzKOXDkYTBGZQA3B+b+DDlvh/2zIjZslg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1741370121; a=rsa-sha256; cv=none; b=jOeHpu0gHfnmbiyqxzwaFVDo04trBpsV7SKAh3gZXPSWU4WfFfAj5bU1AJOnghkt/HuoEs Cz6wrHrc/ig2sMtl8DGrtPrfu+GvEFg1+9QWMRVLZgWgoGZY2dEIqF5akJJeofQP98VNvV BaQjsmhFTwHl1AS6S8S1HfVqv7Odpel/liDnp692vNOzpBYFcUzarLAbdkPVwAUj3qmoXQ OO2tFFFkTJGvS7hRfHdeHrh0FzfTI6H+seAI76QLBHefa64soTiPVN76qWVdk10Ib2EAN9 4oXQcWv/YV8CLguvC6Z8GdXfQI/cJSMe+YQrKohKwmrXp2772zgL/yqThb0p+w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1741370121; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fMTAJpSV6wmabkYiP8T2QflFpuJI+DNHkoVfqS5DDNM=; b=DSHZWfkE23ukReC3Ni3JLQeGrTyisqaKhM6juQqRJ0ecBLmYpqF1ITp0arS5M3+e3FkLPS FXvT32s1z64Gd9Lz8jd25GYD/aDM2Cn96EC0++xL1mawEMgD6VSGT87B8UDJzaPQoWEe/S na9vVbMbXo5Gz73eHZq+h9JqqpIpZZzhKwDQ003YyN+8Qr8EuwnRk+X7G8xpQB8vactml+ cfXoSoghxrZDUJo9LO6Q0/pccNbecs6GBUPVW1JdDglyfaxdvkCn8506qhU6oYuyrfIoD2 DchYNMIzE1MoDVZ8W4aZscrNMU9PtqgfVhHs12+3vgSEkU9gBi9YTGhLmtdOAw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z8Ypx1lZszmKw; Fri, 07 Mar 2025 17:55:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 527HtLLd083551; Fri, 7 Mar 2025 17:55:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 527HtLdT083548; Fri, 7 Mar 2025 17:55:21 GMT (envelope-from git) Date: Fri, 7 Mar 2025 17:55:21 GMT Message-Id: <202503071755.527HtLdT083548@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Vladimir Kondratyev Subject: git: 8b04f07eda12 - main - sysmouse(4): Add wsp(4)-style T-Axis reporting. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wulf X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8b04f07eda12badee0617508c37a0d9506acad24 Auto-Submitted: auto-generated The branch main has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=8b04f07eda12badee0617508c37a0d9506acad24 commit 8b04f07eda12badee0617508c37a0d9506acad24 Author: Joshua Rogers AuthorDate: 2025-03-07 17:53:35 +0000 Commit: Vladimir Kondratyev CommitDate: 2025-03-07 17:53:35 +0000 sysmouse(4): Add wsp(4)-style T-Axis reporting. Neither the ums(4) nor psm(4) reporting can be used by the wsp(4) driver, as they rely on static-length movements, while wsp(4) may need to scroll in large amounts per evdev event push. This style uses a false button-5 press as an indicator that the z-axis movement is a horizontal scroll, otherwise a vertical scroll. Signed-off-by: Joshua Rogers --- sys/dev/evdev/evdev.c | 2 +- sys/dev/evdev/evdev.h | 2 ++ sys/dev/syscons/sysmouse.c | 14 +++++++++++--- sys/dev/vt/vt_sysmouse.c | 14 +++++++++++--- 4 files changed, 25 insertions(+), 7 deletions(-) diff --git a/sys/dev/evdev/evdev.c b/sys/dev/evdev/evdev.c index 87cdaeb91e49..e71f4f389d5c 100644 --- a/sys/dev/evdev/evdev.c +++ b/sys/dev/evdev/evdev.c @@ -82,7 +82,7 @@ SYSCTL_INT(_kern_evdev, OID_AUTO, rcpt_mask, CTLFLAG_RWTUN, &evdev_rcpt_mask, 0, "Who is receiving events: bit0 - sysmouse, bit1 - kbdmux, " "bit2 - mouse hardware, bit3 - keyboard hardware"); SYSCTL_INT(_kern_evdev, OID_AUTO, sysmouse_t_axis, CTLFLAG_RWTUN, - &evdev_sysmouse_t_axis, 0, "Extract T-axis from 0-none, 1-ums, 2-psm"); + &evdev_sysmouse_t_axis, 0, "Extract T-axis from 0-none, 1-ums, 2-psm, 3-wsp"); #endif SYSCTL_NODE(_kern_evdev, OID_AUTO, input, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, "Evdev input devices"); diff --git a/sys/dev/evdev/evdev.h b/sys/dev/evdev/evdev.h index 2f00d49c485d..2ee374f184cc 100644 --- a/sys/dev/evdev/evdev.h +++ b/sys/dev/evdev/evdev.h @@ -62,12 +62,14 @@ extern int evdev_rcpt_mask; * 0 - do not extract horizontal wheel movement (default). * 1 - ums(4) horizontal wheel encoding. T-axis is mapped to buttons 6 and 7 * 2 - psm(4) wheels encoding: z = 1,-1 - vert. wheel, z = 2,-2 - horiz. wheel + * 3 - wsp(4) horizontal and vertical encoding. T-axis is mapped to button 5. */ enum { EVDEV_SYSMOUSE_T_AXIS_NONE = 0, EVDEV_SYSMOUSE_T_AXIS_UMS = 1, EVDEV_SYSMOUSE_T_AXIS_PSM = 2, + EVDEV_SYSMOUSE_T_AXIS_WSP = 3, }; extern int evdev_sysmouse_t_axis; diff --git a/sys/dev/syscons/sysmouse.c b/sys/dev/syscons/sysmouse.c index 0e38070d613c..05008c50b950 100644 --- a/sys/dev/syscons/sysmouse.c +++ b/sys/dev/syscons/sysmouse.c @@ -94,7 +94,15 @@ smdev_evdev_write(int x, int y, int z, int buttons) evdev_push_event(sysmouse_evdev, EV_REL, REL_X, x); evdev_push_event(sysmouse_evdev, EV_REL, REL_Y, y); switch (evdev_sysmouse_t_axis) { - case EVDEV_SYSMOUSE_T_AXIS_PSM: + case EVDEV_SYSMOUSE_T_AXIS_WSP: /* 3 */ + if (buttons & (1 << 5)) { + evdev_push_rel(sysmouse_evdev, REL_HWHEEL, z); + buttons &= ~(1 << 5); + } else { + evdev_push_rel(sysmouse_evdev, REL_WHEEL, -z); + } + break; + case EVDEV_SYSMOUSE_T_AXIS_PSM: /* 2 */ switch (z) { case 1: case -1: @@ -106,14 +114,14 @@ smdev_evdev_write(int x, int y, int z, int buttons) break; } break; - case EVDEV_SYSMOUSE_T_AXIS_UMS: + case EVDEV_SYSMOUSE_T_AXIS_UMS: /* 1 */ if (buttons & (1 << 6)) evdev_push_rel(sysmouse_evdev, REL_HWHEEL, 1); else if (buttons & (1 << 5)) evdev_push_rel(sysmouse_evdev, REL_HWHEEL, -1); buttons &= ~((1 << 5)|(1 << 6)); /* PASSTHROUGH */ - case EVDEV_SYSMOUSE_T_AXIS_NONE: + case EVDEV_SYSMOUSE_T_AXIS_NONE: /* 0 */ default: evdev_push_rel(sysmouse_evdev, REL_WHEEL, -z); } diff --git a/sys/dev/vt/vt_sysmouse.c b/sys/dev/vt/vt_sysmouse.c index 5147865fc20f..f2f5a0fa5c3a 100644 --- a/sys/dev/vt/vt_sysmouse.c +++ b/sys/dev/vt/vt_sysmouse.c @@ -128,7 +128,15 @@ sysmouse_evdev_store(int x, int y, int z, int buttons) evdev_push_event(sysmouse_evdev, EV_REL, REL_X, x); evdev_push_event(sysmouse_evdev, EV_REL, REL_Y, y); switch (evdev_sysmouse_t_axis) { - case EVDEV_SYSMOUSE_T_AXIS_PSM: + case EVDEV_SYSMOUSE_T_AXIS_WSP: /* 3 */ + if (buttons & (1 << 5)) { + evdev_push_rel(sysmouse_evdev, REL_HWHEEL, z); + buttons &= ~(1 << 5); + } else { + evdev_push_rel(sysmouse_evdev, REL_WHEEL, -z); + } + break; + case EVDEV_SYSMOUSE_T_AXIS_PSM: /* 2 */ switch (z) { case 1: case -1: @@ -140,14 +148,14 @@ sysmouse_evdev_store(int x, int y, int z, int buttons) break; } break; - case EVDEV_SYSMOUSE_T_AXIS_UMS: + case EVDEV_SYSMOUSE_T_AXIS_UMS: /* 1 */ if (buttons & (1 << 6)) evdev_push_rel(sysmouse_evdev, REL_HWHEEL, 1); else if (buttons & (1 << 5)) evdev_push_rel(sysmouse_evdev, REL_HWHEEL, -1); buttons &= ~((1 << 5)|(1 << 6)); /* PASSTHROUGH */ - case EVDEV_SYSMOUSE_T_AXIS_NONE: + case EVDEV_SYSMOUSE_T_AXIS_NONE: /* 0 */ default: evdev_push_rel(sysmouse_evdev, REL_WHEEL, -z); }