svn commit: r325297 - in head/sys/dev: syscons vt

Vladimir Kondratyev wulf at FreeBSD.org
Wed Nov 1 22:30:38 UTC 2017


Author: wulf
Date: Wed Nov  1 22:30:36 2017
New Revision: 325297
URL: https://svnweb.freebsd.org/changeset/base/325297

Log:
  sysmouse(4): Fix ums(4)-style T-axis reporting via evdev protocol
  
  - Do not report T-axis wheel events as button presses
  - Reverse T-axis to match Linux
  - Remove wrong comment. T-axis buttons state should be checked by level not
      by edge to allow continuous wheel tilt reporting
  
  Reviewed by:		gonzo
  Approved by:		gonzo (mentor)
  MFC after:		2 weeks
  Differential Revision:	https://reviews.freebsd.org/D12676

Modified:
  head/sys/dev/syscons/sysmouse.c
  head/sys/dev/vt/vt_sysmouse.c

Modified: head/sys/dev/syscons/sysmouse.c
==============================================================================
--- head/sys/dev/syscons/sysmouse.c	Wed Nov  1 22:19:19 2017	(r325296)
+++ head/sys/dev/syscons/sysmouse.c	Wed Nov  1 22:30:36 2017	(r325297)
@@ -107,11 +107,11 @@ smdev_evdev_write(int x, int y, int z, int buttons)
 		}
 		break;
 	case EVDEV_SYSMOUSE_T_AXIS_UMS:
-		/* XXX: Edge triggering should be used here */
-		if (buttons & (1 << 5))
+		if (buttons & (1 << 6))
 			evdev_push_rel(sysmouse_evdev, REL_HWHEEL, 1);
-		else if (buttons & (1 << 6))
+		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:
 	default:

Modified: head/sys/dev/vt/vt_sysmouse.c
==============================================================================
--- head/sys/dev/vt/vt_sysmouse.c	Wed Nov  1 22:19:19 2017	(r325296)
+++ head/sys/dev/vt/vt_sysmouse.c	Wed Nov  1 22:30:36 2017	(r325297)
@@ -139,11 +139,11 @@ sysmouse_evdev_store(int x, int y, int z, int buttons)
 		}
 		break;
 	case EVDEV_SYSMOUSE_T_AXIS_UMS:
-		/* XXX: Edge triggering should be used here */
-		if (buttons & (1 << 5))
+		if (buttons & (1 << 6))
 			evdev_push_rel(sysmouse_evdev, REL_HWHEEL, 1);
-		else if (buttons & (1 << 6))
+		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:
 	default:


More information about the svn-src-all mailing list