Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp37040rwr; Wed, 3 May 2023 22:01:05 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6gaiUfE5LepY742MygFyEs41U2drQX1LnYW57yQ6rrOb3NDAVnzxeEIjiP+M9+MnxGwUoV X-Received: by 2002:a05:6a21:328a:b0:ef:b02a:b35b with SMTP id yt10-20020a056a21328a00b000efb02ab35bmr1430718pzb.0.1683176465498; Wed, 03 May 2023 22:01:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683176465; cv=none; d=google.com; s=arc-20160816; b=VfH7VcNbBCyXn5nW8NQYuXlKK8lq3muoJiMp1X909fE0sUc/2YC7aTopNGhvSpxwRP ekC+ij0fkNUVs7nnq62UmF/tDaZRKKczJ3yDnFJV+cDd5srfpLaWP611BkIdUVtLTI7E hLMD80rKExgRru4Ao+KjdmiVccpomfMRfN6/cIO6vgIvVttb8CPS/KLNgbesNul36w0d XKbJmkLFZNdwEPj52CMRahL3/ptgqJPjsknE4omvRbwvSKwj4hvWcqguG8RVMIDc+Gol ZV9eEzKd9efFkAx+X1hbKrLj3u3aQe/R2MR/4a+MdZ8+Nd6rcexubv1zimU2Xgcvby/y 700Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:feedback-id:dkim-signature:dkim-signature; bh=ZWknfOeAL8oARcgU8JU8rBehj/kg0W2299E1L9NBPpg=; b=u2HJXrhdjte8+BoY7OEIyJUuf0dXO0hx+kkiUeUrdiSz33Qh0+lNEesDssvwURHFzn kJvcxo0B8pGBSS3QapKZx1NW+qvXFhjZ3J5yttXq5dmCfJsS63+9aVZGGE8FzNXcc/8w CfOzekhzTYWVY3i0GF29Uq4blhE21MNutiwoPXvIDrOLNxsku6U0RmMG3xatcR8/EIGk RDPqHPYiDkUBrPcb/MEUKP+HVOxseZO/j9grYwlChzU4voNeU3G7hnmUS7kof8C1Sryy MwwP3PE0hWvBhTCoOhpZexdMfMiiYHfqObI8qRBWyq1GahiCkRLHmaD6RzEOA7fQoVk/ GQWw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@who-t.net header.s=fm2 header.b=SC0Nie4K; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=bcWeT78J; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l185-20020a6388c2000000b005077dda047csi4095268pgd.803.2023.05.03.22.00.52; Wed, 03 May 2023 22:01:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@who-t.net header.s=fm2 header.b=SC0Nie4K; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=bcWeT78J; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229609AbjEDE3m (ORCPT + 99 others); Thu, 4 May 2023 00:29:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40140 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229470AbjEDE3k (ORCPT ); Thu, 4 May 2023 00:29:40 -0400 Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A02B4E7; Wed, 3 May 2023 21:29:38 -0700 (PDT) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 2350D5C02FF; Thu, 4 May 2023 00:29:37 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Thu, 04 May 2023 00:29:37 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=who-t.net; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to; s=fm2; t= 1683174577; x=1683260977; bh=ZWknfOeAL8oARcgU8JU8rBehj/kg0W2299E 1L9NBPpg=; b=SC0Nie4KXrxGkrPtbP/AkZ+91+f92hwe7tjzAmER22sP5BePZGk I9bIHcvD1YjvyWyfSY2UF+o0XMivFUlalvaBQ9f/ED4qvosGevnkm6ltt04nIrQc zpoCnWp6PRKZ+3dnuzxvsFTAIUQg1+lkOiNbgB2pQ9wqjBnZN1s/xGfwxOATQFL9 wAAm93jwgrWR7GDYjNJtsHVIehMIIJ2kRfsT6eR0JGRl1XwzYN8XKIroBHImcVoy GKGLpKNnkRPmqh9qTeqqs1F5eu9qkUkqJlYEWgEzHqqeCGReFXEEimN5A+x8OITg FYiyxQas4uI88RBBJoTzsDPGS2UJzZRr8BQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t= 1683174577; x=1683260977; bh=ZWknfOeAL8oARcgU8JU8rBehj/kg0W2299E 1L9NBPpg=; b=bcWeT78JW9sItRwCE3z7BqwZSs++zBqDI5KNQkEQeJ4WgWNX0AR cxhpby/J7xncnHSmuQNimTt/Qk08LKQZMwFteaybXuTk5gs2xuacSI++DKTAZ1qj EN9fhM0AdbZuzPjWasLdEPousLfsTRMIvWrjxNQF5kPvJBaX5btJt8x94Q0LSFOb MtWfD0kXD1hDVy8AvgmHLT3gqSzPllcYntIUHw4KNdeSAdiPUhXPxxMPIFxvqNQ1 bhBmSA8vp5xDCScIY66Rnq5BWI44QTgEdfzwvVfnF15Hy3r7Sk7+5J5lKTWmm5Am I+kh0QfXUkL5zB9bBOP35w3XO4quCaq5cTA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrfedvledgkeefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvfevuffkfhggtggugfgjsehtkeertddttddunecuhfhrohhmpefrvght vghrucfjuhhtthgvrhgvrhcuoehpvghtvghrrdhhuhhtthgvrhgvrhesfihhohdqthdrnh gvtheqnecuggftrfgrthhtvghrnhepleeitdfhjeegkeegkeekleejjeegledvudekhfdt keegieeuvdffleeffedtffdtnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpe hmrghilhhfrhhomhepphgvthgvrhdrhhhuthhtvghrvghrseifhhhoqdhtrdhnvght X-ME-Proxy: Feedback-ID: i7ce144cd:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 4 May 2023 00:29:30 -0400 (EDT) Date: Thu, 4 May 2023 14:29:27 +1000 From: Peter Hutterer To: Jeff LaBundy Cc: Javier Carrasco , Thomas =?iso-8859-1?Q?Wei=DFschuh?= , linux-input@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Dmitry Torokhov , Rob Herring , Krzysztof Kozlowski , Henrik Rydberg , Ulf Hansson , Hans Verkuil , Stephen Boyd , Sebastian Reichel , Linus Walleij , Jonathan Cameron , Uwe Kleine-g , Bastian Hecht , Michael Riesch Subject: Re: [RFC v1 0/4] Input: support virtual objects on touchscreens Message-ID: <20230504042927.GA1129520@quokka> References: <20230425115049.870003-1-javier.carrasco@wolfvision.net> <419c9d72-9791-46ff-8317-b4dfe2e2d0a3@t-8ch.de> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Apr 27, 2023 at 12:23:14PM -0500, Jeff LaBundy wrote: > Hi Javier, > > On Thu, Apr 27, 2023 at 05:59:42PM +0200, Javier Carrasco wrote: > > Hi, > > > > On 25.04.23 18:02, Jeff LaBundy wrote: > > > Hi Thomas, > > > > > > On Tue, Apr 25, 2023 at 05:29:39PM +0200, Thomas Wei?schuh wrote: > > >> Hi Javier, > > >> > > >> On 2023-04-25 13:50:45+0200, Javier Carrasco wrote: > > >>> Some touchscreens are shipped with a physical layer on top of them where > > >>> a number of buttons and a resized touchscreen surface might be available. > > >>> > > >>> In order to generate proper key events by overlay buttons and adjust the > > >>> touch events to a clipped surface, these patches offer a documented, > > >>> device-tree-based solution by means of helper functions. > > >>> An implementation for a specific touchscreen driver is also included. > > >>> > > >>> The functions in ts-virtobj provide a simple workflow to acquire > > >>> physical objects from the device tree, map them into the device driver > > >>> structures as virtual objects and generate events according to > > >>> the object descriptions. > > >>> > > >>> This solution has been tested with a JT240MHQS-E3 display, which uses > > >>> the st1624 as a touchscreen and provides two overly buttons and a frame > > >>> that clips its effective surface. > > >> > > >> There are quite a few of notebooks from Asus that feature a printed > > >> numpad on their touchpad [0]. The mapping from the touch events to the > > >> numpad events needs to happen in software. > > > > > > That example seems a kind of fringe use-case in my opinion; I think the > > > gap filled by this RFC is the case where a touchscreen has a printed > > > overlay with a key that represents a fixed function. > > > > Exactly, this RFC addresses exactly such printed overlays. > > > > > > One problem I do see here is something like libinput or multitouch taking > > > hold of the input device, and swallowing the key presses because it sees > > > the device as a touchscreen and is not interested in these keys. > > > > Unfortunately I do not know libinput or multitouch and I might be > > getting you wrong, but I guess the same would apply to any event > > consumer that takes touchscreens as touch event producers and nothing else. > > > > Should they not check the supported events from the device instead of > > making such assumptions? This RFC adds key events defined in the device > > tree and they are therefore available and published as device > > capabilities. That is for example what evtest does to report the > > supported events and they are then notified accordingly. Is that not the > > right way to do it? > > evtest is just that, a test tool. It's handy for ensuring the device emits > the appropriate input events in response to hardware inputs, but it is not > necessarily representative of how the input device may be used in practice. ftr, I strongly recommend "libinput record" over evtest since it can be replayed. And for libinput testing "libinput debug-events" to see what comes out of libinput. > I would encourage you to test this solution with a simple use-case such as > Raspbian, and the virtual keys mapped to easily recognizable functions like > volume up/down. > > Here, you will find that libinput will grab the device and declare it to be > a touchscreen based on the input events it advertises. However, you will not > see volume up/down keys are handled. that would be a bug in libinput. libinput doesn't classify devices. It uses *internal* backends but the backend for keyboard and touchscreen devices is the same. So as long as your device advertises the various EV_KEY and EV_ABS bit correctly, things should just work. If that's not the case for a device please file a bug. It's still "better" to split it up into different event nodes because a lot of userspace may not be able to handle touchscreen+keyboard devices but at least at the libinput level this shouldn't be a problem. And the xf86-input-libinput driver splits up such devices at the X level, so even where a device is touchscreen + keyboard you would end up with two X devices with separate capabilities so they fit into the X "everything is either a pointer or a keyboard" worldview. Cheers, Peter