linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] input: mt: Add hovering distance axis
@ 2010-12-07  8:27 Henrik Rydberg
  2010-12-07 10:41 ` Dmitry Torokhov
  2010-12-08 17:46 ` Chase Douglas
  0 siblings, 2 replies; 11+ messages in thread
From: Henrik Rydberg @ 2010-12-07  8:27 UTC (permalink / raw)
  To: Dmitry Torokhov; +Cc: Jiri Kosina, linux-input, linux-kernel, Henrik Rydberg

Touch devices capable of hovering, i.e., fingers detected a distance
from the surface, are not supported by the current input MT
protocol. This patch adds ABS_MT_DISTANCE, which may be used to
indicate the distance between the contact and the surface.

Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
---
 Documentation/input/multi-touch-protocol.txt |    9 ++++++++-
 include/linux/input.h                        |    3 ++-
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/Documentation/input/multi-touch-protocol.txt b/Documentation/input/multi-touch-protocol.txt
index bdcba15..07215fa 100644
--- a/Documentation/input/multi-touch-protocol.txt
+++ b/Documentation/input/multi-touch-protocol.txt
@@ -161,7 +161,8 @@ against the glass. The inner region will increase, and in general, the
 ratio ABS_MT_TOUCH_MAJOR / ABS_MT_WIDTH_MAJOR, which is always smaller than
 unity, is related to the contact pressure. For pressure-based devices,
 ABS_MT_PRESSURE may be used to provide the pressure on the contact area
-instead.
+instead. Devices capable of contact hovering can use ABS_MT_DISTANCE to
+indicate the distance between the contact and the surface.
 
 In addition to the MAJOR parameters, the oval shape of the contact can be
 described by adding the MINOR parameters, such that MAJOR and MINOR are the
@@ -213,6 +214,12 @@ The pressure, in arbitrary units, on the contact area. May be used instead
 of TOUCH and WIDTH for pressure-based devices or any device with a spatial
 signal intensity distribution.
 
+ABS_MT_DISTANCE
+
+The distance, in surface units, between the contact and the surface. Zero
+distance means the contact is touching the surface. A positive number means
+the contact is hovering above the surface.
+
 ABS_MT_ORIENTATION
 
 The orientation of the ellipse. The value should describe a signed quarter
diff --git a/include/linux/input.h b/include/linux/input.h
index 1fc268b..08013aa 100644
--- a/include/linux/input.h
+++ b/include/linux/input.h
@@ -766,11 +766,12 @@ struct input_keymap_entry {
 #define ABS_MT_BLOB_ID		0x38	/* Group a set of packets as a blob */
 #define ABS_MT_TRACKING_ID	0x39	/* Unique ID of initiated contact */
 #define ABS_MT_PRESSURE		0x3a	/* Pressure on contact area */
+#define ABS_MT_DISTANCE		0x3b	/* Contact hover distance */
 
 #ifdef __KERNEL__
 /* Implementation details, userspace should not care about these */
 #define ABS_MT_FIRST		ABS_MT_TOUCH_MAJOR
-#define ABS_MT_LAST		ABS_MT_PRESSURE
+#define ABS_MT_LAST		ABS_MT_DISTANCE
 #endif
 
 #define ABS_MAX			0x3f
-- 
1.7.1


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [PATCH] input: mt: Add hovering distance axis
  2010-12-07  8:27 [PATCH] input: mt: Add hovering distance axis Henrik Rydberg
@ 2010-12-07 10:41 ` Dmitry Torokhov
  2010-12-08 17:46 ` Chase Douglas
  1 sibling, 0 replies; 11+ messages in thread
From: Dmitry Torokhov @ 2010-12-07 10:41 UTC (permalink / raw)
  To: Henrik Rydberg; +Cc: Jiri Kosina, linux-input, linux-kernel

On Tue, Dec 07, 2010 at 09:27:48AM +0100, Henrik Rydberg wrote:
> Touch devices capable of hovering, i.e., fingers detected a distance
> from the surface, are not supported by the current input MT
> protocol. This patch adds ABS_MT_DISTANCE, which may be used to
> indicate the distance between the contact and the surface.
> 

Makes sense.

Thanks.

-- 
Dmitry

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] input: mt: Add hovering distance axis
  2010-12-07  8:27 [PATCH] input: mt: Add hovering distance axis Henrik Rydberg
  2010-12-07 10:41 ` Dmitry Torokhov
@ 2010-12-08 17:46 ` Chase Douglas
  2010-12-08 18:05   ` Dmitry Torokhov
  1 sibling, 1 reply; 11+ messages in thread
From: Chase Douglas @ 2010-12-08 17:46 UTC (permalink / raw)
  To: Henrik Rydberg; +Cc: Dmitry Torokhov, Jiri Kosina, linux-input, linux-kernel

On 12/07/2010 12:27 AM, Henrik Rydberg wrote:
> Touch devices capable of hovering, i.e., fingers detected a distance
> from the surface, are not supported by the current input MT
> protocol. This patch adds ABS_MT_DISTANCE, which may be used to
> indicate the distance between the contact and the surface.

Have you given thought to calling it ABS_MT_Z instead? I have no real
problem with ABS_MT_DISTANCE per se, but ABS_MT_Z is more clearly
defined in my head. If I was new to MT development I may wonder if
ABS_MT_DISTANCE had anything to do with distance between points or some
other object.

-- Chase

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] input: mt: Add hovering distance axis
  2010-12-08 17:46 ` Chase Douglas
@ 2010-12-08 18:05   ` Dmitry Torokhov
  2010-12-08 18:16     ` Henrik Rydberg
  2010-12-08 18:20     ` Ping Cheng
  0 siblings, 2 replies; 11+ messages in thread
From: Dmitry Torokhov @ 2010-12-08 18:05 UTC (permalink / raw)
  To: Chase Douglas
  Cc: Henrik Rydberg, Jiri Kosina, linux-input, linux-kernel,
	Ping Cheng

On Wed, Dec 08, 2010 at 09:46:04AM -0800, Chase Douglas wrote:
> On 12/07/2010 12:27 AM, Henrik Rydberg wrote:
> > Touch devices capable of hovering, i.e., fingers detected a distance
> > from the surface, are not supported by the current input MT
> > protocol. This patch adds ABS_MT_DISTANCE, which may be used to
> > indicate the distance between the contact and the surface.
> 
> Have you given thought to calling it ABS_MT_Z instead? I have no real
> problem with ABS_MT_DISTANCE per se, but ABS_MT_Z is more clearly
> defined in my head. If I was new to MT development I may wonder if
> ABS_MT_DISTANCE had anything to do with distance between points or some
> other object.

X/Y/Z imply that we fully engaged the device and it is 3 dimensional.
Distance says that we are approaching the device but have not directly
engaged it yet.

I think ABS_DISTANCE was added at Pings request and ABS_MT_DISTANCE is
modeled after ST one. Ping, could you refresh my memory why we needed
ABS_DISTANCE?

Thanks.

-- 
Dmitry

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] input: mt: Add hovering distance axis
  2010-12-08 18:05   ` Dmitry Torokhov
@ 2010-12-08 18:16     ` Henrik Rydberg
  2010-12-08 18:20     ` Ping Cheng
  1 sibling, 0 replies; 11+ messages in thread
From: Henrik Rydberg @ 2010-12-08 18:16 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: Chase Douglas, Jiri Kosina, linux-input, linux-kernel, Ping Cheng

On 12/08/2010 07:05 PM, Dmitry Torokhov wrote:

> On Wed, Dec 08, 2010 at 09:46:04AM -0800, Chase Douglas wrote:
>> On 12/07/2010 12:27 AM, Henrik Rydberg wrote:
>>> Touch devices capable of hovering, i.e., fingers detected a distance
>>> from the surface, are not supported by the current input MT
>>> protocol. This patch adds ABS_MT_DISTANCE, which may be used to
>>> indicate the distance between the contact and the surface.
>>
>> Have you given thought to calling it ABS_MT_Z instead? I have no real
>> problem with ABS_MT_DISTANCE per se, but ABS_MT_Z is more clearly
>> defined in my head. If I was new to MT development I may wonder if
>> ABS_MT_DISTANCE had anything to do with distance between points or some
>> other object.
> 
> X/Y/Z imply that we fully engaged the device and it is 3 dimensional.
> Distance says that we are approaching the device but have not directly
> engaged it yet.


Yep, and we will surely start seeing more 3D devices soon, so reserving _Z for
those is a given.

Thanks,
Henrik

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] input: mt: Add hovering distance axis
  2010-12-08 18:05   ` Dmitry Torokhov
  2010-12-08 18:16     ` Henrik Rydberg
@ 2010-12-08 18:20     ` Ping Cheng
  2010-12-08 18:40       ` Henrik Rydberg
  1 sibling, 1 reply; 11+ messages in thread
From: Ping Cheng @ 2010-12-08 18:20 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: Chase Douglas, Henrik Rydberg, Jiri Kosina, linux-input,
	linux-kernel, Ping Cheng

On Wed, Dec 8, 2010 at 10:05 AM, Dmitry Torokhov
<dmitry.torokhov@gmail.com> wrote:
> On Wed, Dec 08, 2010 at 09:46:04AM -0800, Chase Douglas wrote:
>> On 12/07/2010 12:27 AM, Henrik Rydberg wrote:
>> > Touch devices capable of hovering, i.e., fingers detected a distance
>> > from the surface, are not supported by the current input MT
>> > protocol. This patch adds ABS_MT_DISTANCE, which may be used to
>> > indicate the distance between the contact and the surface.
>>
>> Have you given thought to calling it ABS_MT_Z instead? I have no real
>> problem with ABS_MT_DISTANCE per se, but ABS_MT_Z is more clearly
>> defined in my head. If I was new to MT development I may wonder if
>> ABS_MT_DISTANCE had anything to do with distance between points or some
>> other object.
>
> X/Y/Z imply that we fully engaged the device and it is 3 dimensional.
> Distance says that we are approaching the device but have not directly
> engaged it yet.
>
> I think ABS_DISTANCE was added at Pings request and ABS_MT_DISTANCE is
> modeled after ST one. Ping, could you refresh my memory why we needed
> ABS_DISTANCE?

ABS_DISTANCE is used in wacom driver as the distance between the tool
tip and the tablet.

Ping

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] input: mt: Add hovering distance axis
  2010-12-08 18:20     ` Ping Cheng
@ 2010-12-08 18:40       ` Henrik Rydberg
  2010-12-08 23:31         ` Ping Cheng
  0 siblings, 1 reply; 11+ messages in thread
From: Henrik Rydberg @ 2010-12-08 18:40 UTC (permalink / raw)
  To: Ping Cheng
  Cc: Dmitry Torokhov, Chase Douglas, Jiri Kosina, linux-input,
	linux-kernel, Ping Cheng

On 12/08/2010 07:20 PM, Ping Cheng wrote:

> On Wed, Dec 8, 2010 at 10:05 AM, Dmitry Torokhov
> <dmitry.torokhov@gmail.com> wrote:
>> On Wed, Dec 08, 2010 at 09:46:04AM -0800, Chase Douglas wrote:
>>> On 12/07/2010 12:27 AM, Henrik Rydberg wrote:
>>>> Touch devices capable of hovering, i.e., fingers detected a distance
>>>> from the surface, are not supported by the current input MT
>>>> protocol. This patch adds ABS_MT_DISTANCE, which may be used to
>>>> indicate the distance between the contact and the surface.
>>>
>>> Have you given thought to calling it ABS_MT_Z instead? I have no real
>>> problem with ABS_MT_DISTANCE per se, but ABS_MT_Z is more clearly
>>> defined in my head. If I was new to MT development I may wonder if
>>> ABS_MT_DISTANCE had anything to do with distance between points or some
>>> other object.
>>
>> X/Y/Z imply that we fully engaged the device and it is 3 dimensional.
>> Distance says that we are approaching the device but have not directly
>> engaged it yet.
>>
>> I think ABS_DISTANCE was added at Pings request and ABS_MT_DISTANCE is
>> modeled after ST one. Ping, could you refresh my memory why we needed
>> ABS_DISTANCE?
> 
> ABS_DISTANCE is used in wacom driver as the distance between the tool
> tip and the tablet.


Thanks for the confirmation. While at it, what are the units for the distance,
for instance for the Cintiq?

Henrik

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] input: mt: Add hovering distance axis
  2010-12-08 18:40       ` Henrik Rydberg
@ 2010-12-08 23:31         ` Ping Cheng
  2010-12-08 23:54           ` Dmitry Torokhov
  0 siblings, 1 reply; 11+ messages in thread
From: Ping Cheng @ 2010-12-08 23:31 UTC (permalink / raw)
  To: Henrik Rydberg
  Cc: Dmitry Torokhov, Chase Douglas, Jiri Kosina, linux-input,
	linux-kernel, Ping Cheng

On Wed, Dec 8, 2010 at 10:40 AM, Henrik Rydberg <rydberg@euromail.se> wrote:
> On 12/08/2010 07:20 PM, Ping Cheng wrote:
>>
>> ABS_DISTANCE is used in wacom driver as the distance between the tool
>> tip and the tablet.
>
>
> Thanks for the confirmation. While at it, what are the units for the distance,
> for instance for the Cintiq?

mm? I am not so sure. It is a rough count of how far the tool is away
from the tablet.

Ping

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] input: mt: Add hovering distance axis
  2010-12-08 23:31         ` Ping Cheng
@ 2010-12-08 23:54           ` Dmitry Torokhov
  2010-12-09  0:08             ` Ping Cheng
  0 siblings, 1 reply; 11+ messages in thread
From: Dmitry Torokhov @ 2010-12-08 23:54 UTC (permalink / raw)
  To: Ping Cheng
  Cc: Henrik Rydberg, Chase Douglas, Jiri Kosina, linux-input,
	linux-kernel, Ping Cheng

On Wed, Dec 08, 2010 at 03:31:12PM -0800, Ping Cheng wrote:
> On Wed, Dec 8, 2010 at 10:40 AM, Henrik Rydberg <rydberg@euromail.se> wrote:
> > On 12/08/2010 07:20 PM, Ping Cheng wrote:
> >>
> >> ABS_DISTANCE is used in wacom driver as the distance between the tool
> >> tip and the tablet.
> >
> >
> > Thanks for the confirmation. While at it, what are the units for the distance,
> > for instance for the Cintiq?
> 
> mm? I am not so sure. It is a rough count of how far the tool is away
> from the tablet.

Count in what units? Millimeters, light years, pumpkins? ;)

-- 
Dmitry

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] input: mt: Add hovering distance axis
  2010-12-08 23:54           ` Dmitry Torokhov
@ 2010-12-09  0:08             ` Ping Cheng
  2010-12-09  0:13               ` Dmitry Torokhov
  0 siblings, 1 reply; 11+ messages in thread
From: Ping Cheng @ 2010-12-09  0:08 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: Henrik Rydberg, Chase Douglas, Jiri Kosina, linux-input,
	linux-kernel, Ping Cheng

On Wed, Dec 8, 2010 at 3:54 PM, Dmitry Torokhov
<dmitry.torokhov@gmail.com> wrote:
> On Wed, Dec 08, 2010 at 03:31:12PM -0800, Ping Cheng wrote:
>> On Wed, Dec 8, 2010 at 10:40 AM, Henrik Rydberg <rydberg@euromail.se> wrote:
>> > On 12/08/2010 07:20 PM, Ping Cheng wrote:
>> >>
>> >> ABS_DISTANCE is used in wacom driver as the distance between the tool
>> >> tip and the tablet.
>> >
>> >
>> > Thanks for the confirmation. While at it, what are the units for the distance,
>> > for instance for the Cintiq?
>>
>> mm? I am not so sure. It is a rough count of how far the tool is away
>> from the tablet.
>
> Count in what units? Millimeters, light years, pumpkins? ;)

I said mm (millimeters ;).

Ping

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] input: mt: Add hovering distance axis
  2010-12-09  0:08             ` Ping Cheng
@ 2010-12-09  0:13               ` Dmitry Torokhov
  0 siblings, 0 replies; 11+ messages in thread
From: Dmitry Torokhov @ 2010-12-09  0:13 UTC (permalink / raw)
  To: Ping Cheng
  Cc: Henrik Rydberg, Chase Douglas, Jiri Kosina, linux-input,
	linux-kernel, Ping Cheng

On Wed, Dec 08, 2010 at 04:08:45PM -0800, Ping Cheng wrote:
> On Wed, Dec 8, 2010 at 3:54 PM, Dmitry Torokhov
> <dmitry.torokhov@gmail.com> wrote:
> > On Wed, Dec 08, 2010 at 03:31:12PM -0800, Ping Cheng wrote:
> >> On Wed, Dec 8, 2010 at 10:40 AM, Henrik Rydberg <rydberg@euromail.se> wrote:
> >> > On 12/08/2010 07:20 PM, Ping Cheng wrote:
> >> >>
> >> >> ABS_DISTANCE is used in wacom driver as the distance between the tool
> >> >> tip and the tablet.
> >> >
> >> >
> >> > Thanks for the confirmation. While at it, what are the units for the distance,
> >> > for instance for the Cintiq?
> >>
> >> mm? I am not so sure. It is a rough count of how far the tool is away
> >> from the tablet.
> >
> > Count in what units? Millimeters, light years, pumpkins? ;)
> 
> I said mm (millimeters ;).
> 

Ah, I took your "mm" as if you hummed. :P

-- 
Dmitry

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2010-12-09  0:13 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-12-07  8:27 [PATCH] input: mt: Add hovering distance axis Henrik Rydberg
2010-12-07 10:41 ` Dmitry Torokhov
2010-12-08 17:46 ` Chase Douglas
2010-12-08 18:05   ` Dmitry Torokhov
2010-12-08 18:16     ` Henrik Rydberg
2010-12-08 18:20     ` Ping Cheng
2010-12-08 18:40       ` Henrik Rydberg
2010-12-08 23:31         ` Ping Cheng
2010-12-08 23:54           ` Dmitry Torokhov
2010-12-09  0:08             ` Ping Cheng
2010-12-09  0:13               ` Dmitry Torokhov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).