Thread (3 messages) 3 messages, 2 authors, 2017-05-09

Re: The way of touch finger and pen stylus report

flat view

From: Benjamin Tissoires <hidden>
Date: 2017-05-05 07:32:55

Hi Scott,

On Fri, May 5, 2017 at 9:10 AM, 劉嘉駿 [off-list ref] wrote:
I would like to write a touch driver for finger touch and pen stylus.

They have different definition on maximum range of X, Y, Pressure,

additionally, pen have two buttons functionality that need to be reported.



So can driver register two input device to corresponding finger touch and
pen stylus?
Yes, and that's the only way you can achieve that. Each (touch and
pen) should have their own input node.
Otherwise how single input device can map two different X, Y, Pressure
range.
That's not possible. There use to be something roughly like that in
the wacom.ko driver in the past, but this wasn't compatible with
wayland. So now every driver reports 2 input nodes in such cases.


Another thing is that pen stylus has two buttons which enumerate to
Eraser/Invert and Barrel as MS spec said.

Please refer to
https://msdn.microsoft.com/en-us/windows/hardware/commercialize/design/component-guidelines/required-hid-top-level-collections

My question is that how do buttons represents to key bit event? Any example?
HID should handle it properly. You should map it to BTN_TOOL_RUBBER in
case you are not using a HID device.
There is not much to do with this bit: if button is depressed, set the
tool to BTN_TOOL_RUBBER, and when released, switch back to
BTN_TOOL_PEN.

Cheers,
Benjamin


Thanks.



BR,

Scott
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help