Touch input - #612
Conversation
|
Hi Jimmy, Thanks for the review, indeed, this does not address the issue in full. What does this address then? The PR covers basic 'plumbing', touch and tablet (pen) input device handling with Whats missing then? The PR does not cover 'mouse emulation'; translation of touch events to standard pointer/cursor (mouse) movements and/or actions (buttons), gestures, .. etc. My Background I use keyboard for the most and TrackPoint with 3 buttons as my pointer device for the majority of the time. I use the touch for navigating 2D document spaces (Xournal++, PDF viewers, browsers) which are typically designed to work with native touch events. (All I see of SomeWM is a slim bar which I would not try to touch anyway.. :) My Setup I have a ThinkPad with Wacom Touch and Pen and a Samsung Android tablet with touch and pen. I connected them together via History In the first commit, I have pretty much just 'hacked' it together to make it work Current State The touch event handling works with clients actually implementing touch handling. The device life cycle is managed, input-to-output mapping is implemented, event handlers hooked. Going Forward In order to implement mouse emulation or any cursor interaction, the only place to look (I believe) is the event handlers in Considering my habits, I am not necessarily the best person to decide what to actually implement, although I'm happy to work on improving this feature. I would really appreciate 'some' input on what to actually add. While I do have a couple of ideas, I don't really have the capacity to think it through properly, to contemplate what kind of behaviour others might expect. The Catch Having the touch controlling the mouse may not always be desirable since its a different category of events. Especially true when working with multiple screens, you don't always want to warp the cursor over to the other, sort of allowing simultaneous access. Right now, I can open 2 instances of Xournal++ - laptop and tablet - and draw on both simultaneously without any interference while the mouse cursor or the focus is not going anywhere from where I left it. The same is true for touch navigation. Its a pretty good feature for me, the emulation must be optional. By The Way While I'm writing this response and contemplating the architecture I can't help but think of a third party utility which might just do the remapping of the touch events better than I can ever imagine. Previously, Vision If I was to go really hardcore on the touch handling, I'd probably want to have highly configurable emulation per input device per output per client.. etc. Such a feature requires very careful design as it can bring about serious latency with high frequency events. |
|
Thanks so much! Regarding the mouse emulation, I would just recommend following sway. Anyway, that discussion probably belongs in #524. |
correction of typo Co-authored-by: Sicelo <sicelo@users.noreply.github.com>
|
Heh, so I built and tested this on the device mentioned in #524. I can't click anywhere (I guess due to the lacking mouse emulation). Can't bring up menu, etc. However, I can indeed see touch working if I open foot (touch scrolling works) or xournalpp (i can scroll page up and down). Unfortunately at least for my device, the mouse emulation appears to be necessary. 😄 |
|
@zharsing @sicelo That is interesting work, thank you. I do not have much knowledge on touch devices, however, I have these days worked on a tablet support, see #663. When looking at your code, I see that you also include the tablet headers. This leads to the following thoughts of mine:
What do you think? |
|
Hi, credit belongs to @zharsing 😄 I didn't write any code for this. I might be wrong here, but I think touch is a core Wayland protocol, not an add-on, if I could use that terminology, https://wayland.app/protocols/wayland#wl_touch. Thus it is unrelated to tablet-related protocols, although of course touchpads, touchscreens, and tablets might have a lot in common, in general. But yeah, I don't see a major issue if the two are handled in a combined MR. |
|
I looked a bit closer, and superficially I think that touch and tablet can be implemented independently. Maybe @zharsing can comment on it. |
|
Yes, that's what I saw too. There is the issue of pointer emulation, aka. virtual pointer, but that will most likely be handled differently for touchscreens vs. tablets |
|
Hi Stephan, Looks like you have done the heavy lifting. I can see the overlap for sure, it seems to me we attacked the same question from opposite directions. I started from the I don't own a tablet pad, just a touch screen with pen, where the pen is considered a tablet tool. All I was dealing with directly maps to I think the config first approach is a very good idea, especially now we know what we are dealing with. For example, I called it I propose to work together to reconcile the input device management and handling as a single unit of work to ensure consistency. Apart from the configuration and the actual implementation I'd also consider moving the input business from
|
|
I have done some work on touch support as a follow up of the tablet support. See the original PR #692. On a Thinkpad Yoga now both, the tablet pen and the touch display, work, e.g., in krita. Also I tried to streamline discussion on touch support by creating a feature request #707. What do you think? --Stefan p.s. Still thinking about the mouse emulation. It is not part of the implementation yet. |
Description
Basic implementation of touch and pen support (wlr_touch, wlr_tablet, wlr_tablet_tool)
Test Plan
Manual testing
Checklist
lua/awful/,lua/gears/,lua/wibox/,lua/naughty/) are not modified — if a bug surfaces in Lua, the fix belongs in Cmake test-unit && make test-integration)