Bug 104867 - Export the number of touches
Summary: Export the number of touches
Status: RESOLVED FIXED
Alias: None
Product: Wayland
Classification: Unclassified
Component: libinput (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: Wayland bug list
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-01-30 22:33 UTC by Peter Hutterer
Modified: 2018-04-30 23:53 UTC (History)
3 users (show)

See Also:
i915 platform:
i915 features:


Attachments

Description Peter Hutterer 2018-01-30 22:33:05 UTC
See thread at: https://lists.freedesktop.org/archives/wayland-devel/2018-January/036636.html

The number of touches is used to differentiate between multitouch and non-multitouch devices. Could theoretically also be used to identify what user interface is needed (2 touches vs 5+ touches) but let's not pretend anyone is ever going to actually do this...
Comment 1 Peter Hutterer 2018-02-01 03:38:48 UTC
Just a few notes: the TOUCH capability is assigned to any touch device, even single-touch touchscreens. Whether it's single touch or multi-touch is not exposed, but we have device->mt.slots_len with the number of slots internally.

There is no capability API outside of that, the closest we have for querying specific devices is the libinput_device_<type>_has* set of functions to check for buttons or keys. So libinput_device_touch_get_num_touches() would fit, and so would libinput_device_touch_has_multitouch() for a basic boolean check.

CC-ing carlos in case he has any thoughts on using it in mutter.
Comment 2 Carlos Garnacho Parro 2018-02-01 11:06:23 UTC
(In reply to Peter Hutterer from comment #1)
> Just a few notes: the TOUCH capability is assigned to any touch device, even
> single-touch touchscreens. Whether it's single touch or multi-touch is not
> exposed, but we have device->mt.slots_len with the number of slots
> internally.
> 
> There is no capability API outside of that, the closest we have for querying
> specific devices is the libinput_device_<type>_has* set of functions to
> check for buttons or keys. So libinput_device_touch_get_num_touches() would
> fit, and so would libinput_device_touch_has_multitouch() for a basic boolean
> check.
> 
> CC-ing carlos in case he has any thoughts on using it in mutter.

Not specifically tbh. All multitouch functionality is already redundant so we don't have any place where we want to act differently if n_touches==1.
Comment 4 Peter Hutterer 2018-04-03 06:40:45 UTC
No response on the list even with a ping, closing.
Comment 5 Peter Hutterer 2018-04-30 23:53:51 UTC
ok, tests came in after all, pushed as

commit 63e5372190606c5c124eafbc4cac753f59bb9f69
Author: Peter Hutterer <>
Date:   Wed Jan 31 16:04:09 2018 +1000

     Add libinput_device_touch_get_touch_count()


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.