<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.kde.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugs.kde.org/"
          
          maintainer="sysadmin@kde.org"
>

    <bug>
          <bug_id>481737</bug_id>
          
          <creation_ts>2024-02-23 21:55:17 +0000</creation_ts>
          <short_desc>No visual feedback when pressing stylus buttons that emit BTN_TOOL_PEN or  BTN_TOOL_RUBBER</short_desc>
          <delta_ts>2025-03-24 08:19:19 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>4</classification_id>
          <classification>Plasma</classification>
          <product>kwin</product>
          <component>input</component>
          <version>master</version>
          <rep_platform>Other</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>UNCONFIRMED</bug_status>
          <resolution></resolution>
          
          <see_also>https://bugs.kde.org/show_bug.cgi?id=475704</see_also>
    
    <see_also>https://bugs.kde.org/show_bug.cgi?id=469232</see_also>
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>usability</keywords>
          <priority>NOR</priority>
          <bug_severity>minor</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>0</everconfirmed>
          <reporter name="Nate Graham">nate</reporter>
          <assigned_to name="KWin default assignee">kwin-bugs-null</assigned_to>
          <cc>kde</cc>
          
          <cf_commitlink></cf_commitlink>
          <cf_versionfixedin></cf_versionfixedin>
          <cf_sentryurl></cf_sentryurl>
          <votes>0</votes>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2291414</commentid>
    <comment_count>0</comment_count>
    <who name="Nate Graham">nate</who>
    <bug_when>2024-02-23 21:55:17 +0000</bug_when>
    <thetext>See Bug 475704 for the investigation that led here.

I have a stylus with two buttons. When one button is pushed, it emits BTN_TOOL_PEN. When the other is pushed, it emits BTN_TOOL_RUBBER.

In both cases, there is no visual change anywhere to suggest that the buttons are handled and recognized and actually doing anything. Thus I thought they were broken.

In addition to the ability to re-bind these buttons to emit right and middle clicks (which is tracked in Bug 469232), it would be better if there was some kind of visual status change to so the user knows that their pen buttons are not broken.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2291918</commentid>
    <comment_count>1</comment_count>
    <who name="David Redondo">kde</who>
    <bug_when>2024-02-26 09:19:40 +0000</bug_when>
    <thetext>That&apos;s on the app and kinda hard to do. 

These evdev events indicate not button presses but that a certain tool is in use with the device see 
https://www.kernel.org/doc/Documentation/input/event-codes.txt

Quoting
* BTN_TOOL_&lt;name&gt;:
  - These codes are used in conjunction with input trackpads, tablets, and
    touchscreens. These devices may be used with fingers, pens, or other tools.
    When an event occurs and a tool is used, the corresponding BTN_TOOL_&lt;name&gt;
    code should be set to a value of 1. When the tool is no longer interacting
    with the input device, the BTN_TOOL_&lt;name&gt; code should be reset to 0. All
    trackpads, tablets, and touchscreens should use at least one BTN_TOOL_&lt;name&gt;
    code when events are generated.

The compositor just sees a &quot;proximity in&quot; event for a tool.
I think it&apos;s not possible to know in general if a tool is the same physical object or not.  
Further reading:

https://gitlab.freedesktop.org/libinput/libinput/-/issues/841#note_1699093
https://wayland.freedesktop.org/libinput/doc/1.12.0/tablet-support.html

I think at some point the user should know what the buttons on their hardware do. Given that we did not receive bug reports about that so far I would make a guess that if you buy a drawing tablet that behavior would be documented and/or known by artists.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2292053</commentid>
    <comment_count>2</comment_count>
    <who name="Nate Graham">nate</who>
    <bug_when>2024-02-26 18:49:21 +0000</bug_when>
    <thetext>&gt; I think at some point the user should know what the buttons on their hardware do.
I feel called out! :D 

FWIW the pen in question is the one that came with my laptop, and it lives in a little garage. Hardware like this is of secondary importance compared to a standalone drawing tablet, so I think we can&apos;t expect the user to be so much of an expert in what the buttons of the pen do.

Maybe Bug 469232 is enough, though.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2292201</commentid>
    <comment_count>3</comment_count>
    <who name="David Redondo">kde</who>
    <bug_when>2024-02-27 07:39:40 +0000</bug_when>
    <thetext>&gt; Maybe Bug 469232 is enough, though.

I am not sure it&apos;s possible for these buttons because we don&apos;t actually see a button press but let&apos;s see.

For exmaple I have a pen and the eraser is at the top of it (like a physical pencil with eraser). These events are generated when I turn that pen around.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2410197</commentid>
    <comment_count>4</comment_count>
    <who name="David Redondo">kde</who>
    <bug_when>2025-03-24 08:19:19 +0000</bug_when>
    <thetext>You might be interested in  https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1158</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>