lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1291936745-4973-1-git-send-email-rydberg@euromail.se>
Date:	Fri, 10 Dec 2010 00:19:05 +0100
From:	"Henrik Rydberg" <rydberg@...omail.se>
To:	Dmitry Torokhov <dmitry.torokhov@...il.com>
Cc:	Jiri Kosina <jkosina@...e.cz>, linux-input@...r.kernel.org,
	linux-kernel@...r.kernel.org, Henrik Rydberg <rydberg@...omail.se>
Subject: [PATCH] input: mt: Identify pointer emulation contact

For MT applications, the tracking id provides a robust way to know
when a touch is new; essential information to determine when _not_ to
emit motion events, for instance.  Currently, ST applications do not
have the equivalent information, but instead rely on global properties
such as a change in number of fingers. Moreover, some MT applications
need to know which contact correponds to the pointer. This patch adds
the ABS_TRACKING_ID axis and emits it in
input_mt_report_pointer_emulation(), provided the proper absbit is
setup by the driver.

Signed-off-by: Henrik Rydberg <rydberg@...omail.se>
---
 drivers/input/input-mt.c |    4 +++-
 include/linux/input.h    |    1 +
 2 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/drivers/input/input-mt.c b/drivers/input/input-mt.c
index afaf059..bcd2c22 100644
--- a/drivers/input/input-mt.c
+++ b/drivers/input/input-mt.c
@@ -105,7 +105,8 @@ EXPORT_SYMBOL(input_mt_report_slot_state);
  * @dev: input device with allocated MT slots
  *
  * Performs legacy pointer emulation via BTN_TOUCH, ABS_X, ABS_Y and
- * ABS_PRESSURE. Touchpad finger count is emulated using
+ * ABS_PRESSURE. If enabled, ABS_TRACKING_ID is emitted whenever the
+ * pointer contact changes. Touchpad finger count is emulated using
  * BTN_TOOL_FINGER, BTN_TOOL_DOUBLETAP, BTN_TOOL_TRIPLETAP and
  * BTN_TOOL_QUADTAP.
  *
@@ -146,6 +147,7 @@ void input_mt_report_pointer_emulation(struct input_dev *dev)
 		input_event(dev, EV_ABS, ABS_X, x);
 		input_event(dev, EV_ABS, ABS_Y, y);
 		input_event(dev, EV_ABS, ABS_PRESSURE, p);
+		input_event(dev, EV_ABS, ABS_TRACKING_ID, oldid);
 	} else {
 		input_event(dev, EV_ABS, ABS_PRESSURE, 0);
 	}
diff --git a/include/linux/input.h b/include/linux/input.h
index 65f7799..01dde9b 100644
--- a/include/linux/input.h
+++ b/include/linux/input.h
@@ -716,6 +716,7 @@ struct input_keymap_entry {
 #define ABS_TILT_X		0x1a
 #define ABS_TILT_Y		0x1b
 #define ABS_TOOL_WIDTH		0x1c
+#define ABS_TRACKING_ID		0x1d	/* ID of contact governing ABS_{X,Y} */
 
 #define ABS_VOLUME		0x20
 
-- 
1.7.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ