Skip to content

Commit 42764f9

Browse files
bentissJiri Kosina
authored andcommitted
Input: docs: add more details on the use of BTN_TOOL
The HID core stack used to be very relaxed considering the BTN_TOOL_* usage. With the recent commits, we should now enforce to have only one tool at a time, meaning that we can now express that requirement in the docs. Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Reviewed-by: Ping Cheng <ping.cheng@wacom.com> Acked-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
1 parent 5c20000 commit 42764f9

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

Documentation/input/event-codes.rst

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,11 @@ A few EV_KEY codes have special meanings:
137137
code should be set to a value of 1. When the tool is no longer interacting
138138
with the input device, the BTN_TOOL_<name> code should be reset to 0. All
139139
trackpads, tablets, and touchscreens should use at least one BTN_TOOL_<name>
140-
code when events are generated.
140+
code when events are generated. Likewise all trackpads, tablets, and
141+
touchscreens should export only one BTN_TOOL_<name> at a time. To not break
142+
existing userspace, it is recommended to not switch tool in one EV_SYN frame
143+
but first emitting the old BTN_TOOL_<name> at 0, then emit one SYN_REPORT
144+
and then set the new BTN_TOOL_<name> at 1.
141145

142146
* BTN_TOUCH:
143147

0 commit comments

Comments
 (0)