Received: by 2002:a05:7412:8521:b0:e2:908c:2ebd with SMTP id t33csp726982rdf; Fri, 3 Nov 2023 13:11:44 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHed/OHYXYv/qXYWAskmcwcX3KqhhmGJM6wDDJ1MBsWTmV3YFRgki3Hj+HSsovom3bkHhs3 X-Received: by 2002:a17:903:187:b0:1cc:50ea:d5c5 with SMTP id z7-20020a170903018700b001cc50ead5c5mr16149940plg.24.1699042303731; Fri, 03 Nov 2023 13:11:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1699042303; cv=none; d=google.com; s=arc-20160816; b=kBuA4hMhz7P9fIS4rn84/LxQq8YeSNw1nIFouuYzyY0MDvn5yJd73aZmoRv86jihba 2r0Aqe74DYo8Myy2jqmtUg6dsE8KEpiYL0Oz1Zy79Mj/FTEh0Le3Hl+w3YlNHHUkuCii h8twUsKFbZQtrlZ6DOayhGYGvH6TRTLKhsODHA6iVILzmcqZjG7uOxJWDLnwltSErWPQ NdSrP1zQ/OIKlwPpFfBslYiSOQB/LtX4iRF4Q0N+fmdjhRg5RfSjlu8/8KqwDHVXad0s snP0a8FJ5HZ9LBPJ94oMTEPEXyWULgiuIAu6yCNphmjdduq1VdrnlIYNEVoSh8X3SfcO D/gg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=V0ItMEOm9fcCq8BtPzky5Wp34ANZzX9NEsqSjieFGA4=; fh=1qr03TQ6QQRj0Clm/JeM5jelkfkh6Ern8RHhK/g16vs=; b=t6Hz5043EMjik4xcyjk5CsEvBhY3B7iNg9tVn2XOV1gqA838amg8T8EkhDvwHBOyYL xyD5Vfe838S/0NXYxA/kJ5ZNIhjzNKDRJ0r84xUyL1xIPqkQLvYMLDfZV8k7pZPXDavb QKg6GdTXOzytrHlUBYWjQpM8z1t9j7mDG31GlV2X+MygdBQyR9nmOYr9Y6pW58YG9gPF qsryrM0oyoOGqD4Mg4zVJCzUJ+4DjitpMRKJ9X+NVZX8OB9Qb5VFJ69R0M/UO6CKi8zg DXGvd6XReaJenQEo0CF4opXCRWeWOvn3rz264wHWG3kQoadLQxkak3Bqd4KRCs6n4Wmz 1r3g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id t3-20020a17090340c300b001c73d73f163si2242669pld.505.2023.11.03.13.11.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Nov 2023 13:11:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 8FC228061172; Fri, 3 Nov 2023 13:11:26 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1378008AbjKCULF (ORCPT + 99 others); Fri, 3 Nov 2023 16:11:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50934 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230379AbjKCULE (ORCPT ); Fri, 3 Nov 2023 16:11:04 -0400 X-Greylist: delayed 310 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Fri, 03 Nov 2023 13:11:00 PDT Received: from mailout1n.rrzn.uni-hannover.de (mailout1n.rrzn.uni-hannover.de [130.75.2.107]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 18A61D63; Fri, 3 Nov 2023 13:10:59 -0700 (PDT) Received: from seminarraum.sra.uni-hannover.de (mmsrv.sra.uni-hannover.de [130.75.33.181]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mailout1n.rrzn.uni-hannover.de (Postfix) with ESMTPSA id CC8161BA9; Fri, 3 Nov 2023 21:05:46 +0100 (CET) From: Illia Ostapyshyn To: jkosina@suse.cz Cc: benjamin.tissoires@redhat.com, davidrevoy@protonmail.com, jason.gerecke@wacom.com, jose.exposito89@gmail.com, linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, nils@nilsfuhler.de, peter.hutterer@who-t.net, ping.cheng@wacom.com, bagasdotme@gmail.com, Illia Ostapyshyn Subject: Re: Requesting your attention and expertise regarding a Tablet/Kernel issue Date: Fri, 3 Nov 2023 21:05:25 +0100 Message-Id: <20231103200524.53930-1-ostapyshyn@sra.uni-hannover.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Virus-Scanned: clamav-milter 0.103.9 at mailout1n X-Virus-Status: Clean X-Spam-Status: No, score=-0.8 required=5.0 tests=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 lipwig.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 (lipwig.vger.email [0.0.0.0]); Fri, 03 Nov 2023 13:11:26 -0700 (PDT) Hello David, Hello Jiri, The XP-Pen hardware reports the Eraser usage for the upper stylus button. Generally, styli report Invert usages when erasing, as described in [1]. XP-Pen digitizers, however, tend to omit them. The generic driver maps the Eraser usage to BTN_TOUCH and the Invert usage to BTN_TOOL_RUBBER. Pens conforming to [1] send the Invert usage first (switching the tool to BTN_TOOL_RUBBER) followed by Eraser, which appears in userspace as a BTN_TOUCH event with the rubber tool set. Due to an oversight, devices not reporting Invert had the BTN_TOOL_RUBBER event masked. This has caused the kernel to send only BTN_TOUCH events without the tool switch when erasing. The situation got worse with refactoring done in 87562fcd1342. An eraser without Invert caused the hidinput_hid_event state machine to get stuck with BTN_TOOL_RUBBER internally (due to it being masked). For the userspace, this looked as if the pen was never hovering again, rendering it unusable until the next reset. 276e14e6c3 fixes this by adding support for digitizers that do not report Invert usages when erasing. --- David, we are sorry that our patch broke your workflow. However, forwarding hardware events *as-is* to the userspace has always been the intended behavior, with a kernel bug preventing it so far. You can still remap the eraser button to a right click using xsetwacom: xsetwacom set "UGTABLET 24 inch PenDisplay eraser" "Button" "1" "3" Replace the device name with the corresponding *eraser* device from "xsetwacom list devices". You can also do this with "xinput set-button-map", which works for libinput as well. We have tested this with several XP-Pen devices, including Artist 24. [1] https://learn.microsoft.com/en-us/windows-hardware/design/component-guidelines/windows-pen-states