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. 😄 |
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)