Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp571255rdh; Thu, 23 Nov 2023 11:49:22 -0800 (PST) X-Google-Smtp-Source: AGHT+IEnisFfIsppRqAe6hpOtWi6hIkFR5h6srMe0xU+3xSxpHjSmPObAPUofd/2HcHdwVoviswG X-Received: by 2002:a05:6a20:8f20:b0:18a:f1f5:c4ae with SMTP id b32-20020a056a208f2000b0018af1f5c4aemr767387pzk.42.1700768962132; Thu, 23 Nov 2023 11:49:22 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1700768962; cv=pass; d=google.com; s=arc-20160816; b=XBOV7HQ1Jk3pmGfgUTNmRuDMTQsYpzOwozZmG8gvoBaP/6JJnLZHo4srSL+vhYpIWa waRbcb0lI3BKWAZPfxByo1CW5aCzSH5C0+JKt7TnWyG1sQkIdeUkmKDHNp6c+vdH8u8G 3xZDmZU/2yh3jmHaAf5wmJBfyRfyzCf49mGKmGrQvrOQ7onJ4b3MlCQN9vrqG1xP/q5s sHGwSb+/CcPQsZEhJ2qq7CIwXuNos1a6+zaUQVQLM/gen5T5IA1MM9lCzOxfbiQC/23j zvt686WMG0Rb6tXl4I2jyay1u7i1aJDc6Kgh2PfXXNd2qMVAMpu0i0VZTUeqDH4YnBAi 4vOQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :in-reply-to:content-language:references:cc:to:subject:from :user-agent:date:message-id:dkim-signature; bh=AKOZtYlUR/+s2aDY0HiUC9doRnnwbV5H5YV8XrFSeog=; fh=C1KklLkocLL/qILosLMRMHyklCy1j64p2iGkQY3O8e8=; b=z4b4yCCD8s69jm0LO4CG+oM/4Y46RddmS1Ze9Ludnd3DAGIEYVGs52Th4CcR0ntiMZ 46KopS9U4SN3zEOQrqwsK+bStkmpziVeNdp6AV3wx51P3NtYNU2QXqm6jWztOj3ErenT J9iTQgIdMUWRaJOJQyXmKaPyhRtxZt22yFSjdOPXuqIqpCqp97Y/uQnGBddAsk8Zn2gl L2OQlXmH93wfz0wA7U3GyVH/8j/ubPwOGUwD1BdyVeRoxnQFRki+rA6KjvbpxIBpKof+ YCJnMXOt1BfTpyIkwbkGS9+snTjP/JPbui4PrXfXNyz7noweWZ9aq3c1MsfHuRTfa5T2 w4vg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@wolfvision.net header.s=selector2 header.b=BqOxpk06; arc=pass (i=1 spf=pass spfdomain=wolfvision.net dkim=pass dkdomain=wolfvision.net dmarc=pass fromdomain=wolfvision.net); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=wolfvision.net Return-Path: Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id bq20-20020a056a02045400b005bdfda8e04asi2296421pgb.733.2023.11.23.11.49.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Nov 2023 11:49:22 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@wolfvision.net header.s=selector2 header.b=BqOxpk06; arc=pass (i=1 spf=pass spfdomain=wolfvision.net dkim=pass dkdomain=wolfvision.net dmarc=pass fromdomain=wolfvision.net); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=wolfvision.net Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id B3843805EB0F; Thu, 23 Nov 2023 11:49:18 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229477AbjKWTs7 (ORCPT + 99 others); Thu, 23 Nov 2023 14:48:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35958 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229453AbjKWTs5 (ORCPT ); Thu, 23 Nov 2023 14:48:57 -0500 Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-vi1eur04on2051.outbound.protection.outlook.com [40.107.8.51]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ED4E59A; Thu, 23 Nov 2023 11:49:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=To9oc6eyLTPyVUgrGTITeVixXiZ50rhUBrKQNv8qO3qWSuKac+aBZYPA4KYJ9JAwesW/CujDWNeG3g8G361nsZt4eiL2Q5HQYayYLAPgzYiKDj5zk6E6cy+WwmHwWUBFHjwKj0MlqrvZU646wqtU1Mixq3VccSIOLgWfUrcTfd5dy6B665LPHLQ2JtHdy2TpjOKVE2CsDaoeOQU8pK8uQ9X0f5LkgqL1OFwAJG27hM09tMJjU2eq8iuNUXuuf79NMTQM+q/qQGNudGHlcEpcPlaoT7rx3Kf+VOAO0xP1w+MQ/Vp7s+KGxveN0FdPUp3kl7iVirlWivfq+qK7Bm1hNQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=AKOZtYlUR/+s2aDY0HiUC9doRnnwbV5H5YV8XrFSeog=; b=EElOQPqs4McyJyzRP9+UaX3OeQJMYm3F4Vd5j3KVEbMHKKOK4F2eEkO+qshLGUwzXeEoBAkJRMV3YjWQcRkmqs7Mk52gvysd9QFfA1pK/ba51Ln7w3dHzBmA+9HgUn+l65By5NUJffmH5BVxllbWGp12q1739cdWbwoVE3P8KDb5YUdX/xaG8fbau632yVkjZ90Ov0Ucoc4tq+2aO7N2LklXSI/G65CsXNFgbtJX/inoQjwcob4CDuygVRxaQdxae2R7HqP+QEq3+e9OpdScN+81ZUGkoSNksADT6x925WbgnrAtoKhahef/Olr2sABhyXSzwEG81k/FhV7hLg9zUw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=wolfvision.net; dmarc=pass action=none header.from=wolfvision.net; dkim=pass header.d=wolfvision.net; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wolfvision.net; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=AKOZtYlUR/+s2aDY0HiUC9doRnnwbV5H5YV8XrFSeog=; b=BqOxpk069AvkEWdW/TXelbMFMLATnJ+wEgP0SJfOY1+1AUZKfJpwRSgkRcT4XNuAwYloqRoG8kr/zW18AfdTlEZGrvJQNUU8dcbJB9EvrtCpq6hrpTe5XUsWwK8TlYOC8NNcAC5OakM3RUcp2YfXEBR6L8JUmOICbb9tcNVJtB8= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=wolfvision.net; Received: from VE1PR08MB4974.eurprd08.prod.outlook.com (2603:10a6:803:111::15) by PAXPR08MB6752.eurprd08.prod.outlook.com (2603:10a6:102:131::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7025.20; Thu, 23 Nov 2023 19:48:59 +0000 Received: from VE1PR08MB4974.eurprd08.prod.outlook.com ([fe80::6b40:1e6f:7c94:71dc]) by VE1PR08MB4974.eurprd08.prod.outlook.com ([fe80::6b40:1e6f:7c94:71dc%4]) with mapi id 15.20.7025.020; Thu, 23 Nov 2023 19:48:59 +0000 Message-ID: <487555fa-72ad-4d1a-ac68-51826f56f1cd@wolfvision.net> Date: Thu, 23 Nov 2023 20:48:56 +0100 User-Agent: Mozilla Thunderbird From: Javier Carrasco Subject: Re: [PATCH v5 2/4] dt-bindings: touchscreen: add overlay-touchscreen and overlay-buttons properties To: Jeff LaBundy Cc: Dmitry Torokhov , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Henrik Rydberg , Bastian Hecht , Michael Riesch , linux-kernel@vger.kernel.org, linux-input@vger.kernel.org, devicetree@vger.kernel.org References: <20230510-feature-ts_virtobj_patch-v5-0-ff6b5c4db693@wolfvision.net> <20230510-feature-ts_virtobj_patch-v5-2-ff6b5c4db693@wolfvision.net> Content-Language: en-US In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-ClientProxiedBy: FR4P281CA0037.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:c7::10) To VE1PR08MB4974.eurprd08.prod.outlook.com (2603:10a6:803:111::15) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: VE1PR08MB4974:EE_|PAXPR08MB6752:EE_ X-MS-Office365-Filtering-Correlation-Id: 3d767b74-7349-4981-05bf-08dbec5d3c21 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: VpJAJRWkKjOoqvnOltfUY0AvPGeQpMgVZiGnoql3KBWZOlFBWJb/946UMuieiVE6MiqVSU+I5yuSBU1GpE2QxrRBihns83Xqs0M78IL67ZZmhXs1+uF/EtWU5T6vT+JjU8s+DPSqSaj0G6mGNV37tlq4xUm1wa8g1rDk8Crg4ZsEbBa5p/ef1223Letnkv3zFfORlpdEgCNYzUmCpxsddrrGokzBQqWlwGBiBTMRfy71xpeiogdtqjIZNsd2MVqTFPvNDZvtdyz7TWvzlo26nJdzKbLnKKQtatEOX+WLHA3wKdRiaf7K1MxuL65DE9/b58joFwIuveMOVoDNjbGU1rCNlHOp7FTDSffLgmh53/bccLsN94R9Qi5UOmTC5NIikbxV0HgaNyUNSM98m4ijOJwdqqoURLaZCLxnCo9KQEHzscTWHGruf1UBqhTpQgmbCFqCNVd/oWwBZF2hNFbSpQBrC5fXDdE/Di+qLOxM6vyUkJYHtwXpaoDVhd35QGr9mjEur20bSKYnuGKh8Fq+Sdc6mobcoik94ojH3M18LDm/bNC+H7H6lFaP68bVCn0s37AnxF2TyNU2AYJPACSZI0u1K6dEvsZZuvHE1i7tyZM3NG0ZIVh3+mGJpqEWSLSyc6yGrZA5nA+QS3YUpbxu4Q== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VE1PR08MB4974.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(366004)(136003)(396003)(39850400004)(376002)(346002)(230922051799003)(186009)(1800799012)(451199024)(64100799003)(7416002)(86362001)(44832011)(5660300002)(31696002)(31686004)(38100700002)(83380400001)(6666004)(6506007)(54906003)(316002)(53546011)(6512007)(2616005)(4326008)(6916009)(66476007)(66556008)(66946007)(8676002)(8936002)(41300700001)(6486002)(478600001)(2906002)(36756003)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?UDdlL2FYSVg5YWhqSnpnamk1UnUydkwyakFRbGxzdklJYlliMlZoRU0rZmVH?= =?utf-8?B?dm50S0hUK1djOHJQZk9VbTh2WnRodUw5cjZBQnQ1cjhmYk15ZFN1WTR2WXZp?= =?utf-8?B?U0Y2amU3YkVURGtnRk5pcEl5bnRmR0ZEL0tPU0NqRUFrZHV1L3c5MUdrK09x?= =?utf-8?B?eldkT2VHdkFjZklGQ3M1Y0hqQStHRkVkRC9IQlZKaCswaDBvMUR2dVBXMU9G?= =?utf-8?B?RDJPUURwRTdtVW9zSHVncVlxNnhzYldmQVFubGZuMytkUFdkM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pWjJNWGdsNFlZWStyYXdITGxLNFIvbVRWNHUzaHgr?= =?utf-8?B?Z0xrZzh5M2taWnJXVi94anN3djhoRFkyL01DMkZoTVcvTjNPMnVXMDVKVGtY?= =?utf-8?B?TW1zcDJVRmR3UkFRcTJNTEVNVmE2L1hYVGpSWEJWc3IxVUMrVVJ5dmFtdWNS?= =?utf-8?Q?BcQqnPtB2aP5U7YcKRgtsPIDUrvTRku7Z2F1pDoAe4=3D?= X-OriginatorOrg: wolfvision.net X-MS-Exchange-CrossTenant-Network-Message-Id: 3d767b74-7349-4981-05bf-08dbec5d3c21 X-MS-Exchange-CrossTenant-AuthSource: VE1PR08MB4974.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Nov 2023 19:48:58.9462 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: e94ec9da-9183-471e-83b3-51baa8eb804f X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: jrpbrlqBP/XM5DhTojugK3Oi2SRJW1WP87soxY7C/vJ/oeG7UYBzKMSgucJwySrWUHET0/zmLsfsZv89vkLyCCsyZ3mcDrUNTOp0HZ+BHnA= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR08MB6752 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Thu, 23 Nov 2023 11:49:18 -0800 (PST) Hi Jeff, On 26.10.23 16:46, Jeff LaBundy wrote: > Hi Javier, > > Thank you for continuing to drive this high-quality work. > > On Tue, Oct 17, 2023 at 01:00:08PM +0200, Javier Carrasco wrote: >> The overlay-touchscreen object defines an area within the touchscreen >> where touch events are reported and their coordinates get converted to >> the overlay origin. This object avoids getting events from areas that >> are physically hidden by overlay frames. >> >> For touchscreens where overlay buttons on the touchscreen surface are >> provided, the overlay-buttons object contains a node for every button >> and the key event that should be reported when pressed. >> >> Signed-off-by: Javier Carrasco >> --- >> .../bindings/input/touchscreen/touchscreen.yaml | 143 +++++++++++++++++++++ >> 1 file changed, 143 insertions(+) >> >> diff --git a/Documentation/devicetree/bindings/input/touchscreen/touchscreen.yaml b/Documentation/devicetree/bindings/input/touchscreen/touchscreen.yaml >> index 431c13335c40..5c58eb79ee9a 100644 >> --- a/Documentation/devicetree/bindings/input/touchscreen/touchscreen.yaml >> +++ b/Documentation/devicetree/bindings/input/touchscreen/touchscreen.yaml >> @@ -87,6 +87,129 @@ properties: >> touchscreen-y-plate-ohms: >> description: Resistance of the Y-plate in Ohms >> >> + overlay-touchscreen: >> + description: Clipped touchscreen area >> + >> + This object can be used to describe a frame that restricts the area >> + within touch events are reported, ignoring the events that occur outside >> + this area. This is of special interest if the touchscreen is shipped >> + with a physical overlay on top of it with a frame that hides some part >> + of the original touchscreen area. >> + >> + The x-origin and y-origin properties of this object define the offset of >> + a new origin from where the touchscreen events are referenced. >> + This offset is applied to the events accordingly. The x-size and y-size >> + properties define the size of the overlay-touchscreen (effective area). >> + >> + The following example shows the new touchscreen area and the new origin >> + (0',0') for the touch events generated by the device. >> + >> + Touchscreen (full area) >> + ┌────────────────────────────────────────┐ >> + │ ┌───────────────────────────────┐ │ >> + │ │ │ │ >> + │ ├ y-size │ │ >> + │ │ │ │ >> + │ │ overlay-touchscreen │ │ >> + │ │ │ │ >> + │ │ │ │ >> + │ │ x-size │ │ >> + │ ┌└──────────────┴────────────────┘ │ >> + │(0',0') │ >> + ┌└────────────────────────────────────────┘ >> + (0,0) >> + >> + where (0',0') = (0+x-origin,0+y-origin) >> + >> + type: object >> + $ref: '#/$defs/overlay-node' >> + unevaluatedProperties: false >> + >> + required: >> + - x-origin >> + - y-origin >> + - x-size >> + - y-size >> + >> + overlay-buttons: >> + description: list of nodes defining the buttons on the touchscreen >> + >> + This object can be used to describe buttons on the touchscreen area, >> + reporting the touch events on their surface as key events instead of >> + the original touch events. >> + >> + This is of special interest if the touchscreen is shipped with a >> + physical overlay on top of it where a number of buttons with some >> + predefined functionality are printed. In that case a specific behavior >> + is expected from those buttons instead of raw touch events. >> + >> + The overlay-buttons properties define a per-button area as well as an >> + origin relative to the real touchscreen origin. Touch events within the >> + button area are reported as the key event defined in the linux,code >> + property. Given that the key events do not provide coordinates, the >> + button origin is only used to place the button area on the touchscreen >> + surface. Any event outside the overlay-buttons object is reported as a >> + touch event with no coordinate transformation. >> + >> + The following example shows a touchscreen with a single button on it >> + >> + Touchscreen (full area) >> + ┌───────────────────────────────────┐ >> + │ │ >> + │ │ >> + │ ┌─────────┐ │ >> + │ │button 0 │ │ >> + │ │KEY_POWER│ │ >> + │ └─────────┘ │ >> + │ │ >> + │ │ >> + ┌└───────────────────────────────────┘ >> + (0,0) >> + >> + The overlay-buttons object can be combined with the overlay-touchscreen >> + object as shown in the following example. In that case only the events >> + within the overlay-touchscreen object are reported as touch events. >> + >> + Touchscreen (full area) >> + ┌─────────┬──────────────────────────────┐ >> + │ │ │ >> + │ │ ┌───────────────────────┐ │ >> + │ button 0│ │ │ │ >> + │KEY_POWER│ │ │ │ >> + │ │ │ │ │ >> + ├─────────┤ │ overlay-touchscreen │ │ >> + │ │ │ │ │ >> + │ │ │ │ │ >> + │ button 1│ │ │ │ >> + │ KEY_INFO│ ┌└───────────────────────┘ │ >> + │ │(0',0') │ >> + ┌└─────────┴──────────────────────────────┘ >> + (0,0) >> + >> + type: object > > I am still confused why the buttons need to live under an 'overlay-buttons' > parent node, which seems like an imaginary boundary. In my view, the touch > surface comprises the following types of rectangular areas: > > 1. A touchscreen, wherein granular coordinates and pressure are reported. > 2. A momentary button, wherein pressure is quantized into a binary value > (press or release), and coordinates are ignored. > > Any contact that falls outside of (1) and (2) is presumed to be part of a > border or matting, and is hence ignored. > > Areas (1) and (2) exist in the same "plane", so why can they not reside > under the same parent node? The following seems much more representative > of the actual hardware we intend to describe in the device tree: > > touchscreen { > compatible = "..."; > reg = <...>; > > /* raw coordinates reported here */ > touch-area-1 { > x-origin = <...>; > y-origin = <...>; > x-size = <...>; > y-size = <...>; > }; > > /* a button */ > touch-area-2a { > x-origin = <...>; > y-origin = <...>; > x-size = <...>; > y-size = <...>; > linux,code = ; > }; > > /* another button */ > touch-area-2b { > x-origin = <...>; > y-origin = <...>; > x-size = <...>; > y-size = <...>; > linux,code = ; > }; > }; > Now that I am working on the approach you suggested, I see that some things can get slightly more complicated. I still think that it is worth a try, but I would like to discuss a couple of points. The node parsing is not that simple anymore because the touch-area nodes are only surrounded by the touchscreen node. Theoretically they could be even be defined with other properties in between. The current approach only needs to find the overlay-buttons parent and iterate over all the inner nodes(simply by calling device_get_named_child_node() and fwnode_for_each_child_node() the parsing is achieved in two lines + error checking). So maybe even if we opt for the single-object approach, an overlay node to group all the touch-areas could simplify the parsing. Or did you have a different approach in mind? Your example would turn into this one: touchscreen { compatible = "..."; reg = <...>; touch-overlay { /* raw coordinates reported here */ touch-area-1 { x-origin = <...>; y-origin = <...>; x-size = <...>; y-size = <...>; }; /* a button */ touch-area-2a { x-origin = <...>; y-origin = <...>; x-size = <...>; y-size = <...>; linux,code = ; }; /* another button */ touch-area-2b { x-origin = <...>; y-origin = <...>; x-size = <...>; y-size = <...>; linux,code = ; }; }; }; In my opinion it looks cleaner as well because you are defining a physical object: the overlay. > With this method, the driver merely stores a list head. The parsing code > then walks the client device node; for each touch* child encountered, it > allocates memory for a structure of five members, and adds it to the list. > The button objects do not only store the keycode, but also the slot and if they are pressed or not. I could allocate memory for these members as well, but maybe an additional struct with the button-specific members set to NULL for the touch areas with keycode = KEY_RESERVED would make sense. I don't know if that's adding too much overhead for two members though. > The event handling code then simply iterates through the list and checks > if the coordinates reported by the hardware fall within each rectangle. If > so, and the keycode in the list element is equal to KEY_RESERVED (zero), > we assume the rectangle is of type (1); the coordinates are passed to > touchscreen_report_pos() and the pressure is reported as well. There is another case to consider that might make the iteration less optimal, but I don't think it will be critical. A button could be defined inside an overlay-touchscreen (no keycode) area. Given that the other way round (a touchscreen inside a button) does not make much sense, the buttons have a higher priority. Let's take your example: imagine that your third area is a button inside the first one. We have to iterate through the whole list until we are sure we checked if there are buttons in the given position, but keeping in mind that the first object already has the right coordinates to handle the touch event. Your approach even allows for multiple no-key areas and we do not know if there are buttons when we iterate (there could be none). Therefore some iterations could be unnecessary, but this is probably an edge case that would cost at most a couple of extra iterations compared to a two-list approach. I will keep on working on the next version with a single list while we clarify these points, so maybe we can save an iteration. > Kind regards, > Jeff LaBundy Best regards, Javier Carrasco