Skip to content

core/wayland: emulate the left mouse button from wl_touch - #161

Merged
vaxerski merged 1 commit into
hyprwm:mainfrom
UncleJ4ck:feat-touch-emulation
Nov 13, 2026
Merged

vaxerski merged 1 commit into
hyprwm:mainfrom
UncleJ4ck:feat-touch-emulation

Conversation

@UncleJ4ck

Copy link
Copy Markdown
Contributor

step 1 of the plan in #36, emulate the mouse by default. this binds wl_touch and feeds the first touch point through the existing mouse path (mouseEnter + left press on down, mouseMove on motion, release + mouseLeave on up or cancel), so buttons, sliders, checkboxes and the rest work on a touchscreen without per-element changes. a second finger is ignored while the first one is held. touch-aware elements can go on top of this later.

buttons act on press, so the release sent on wl_touch.cancel can't click anything, it only ends a drag.

tested with a uinput multitouch device on hyprland: tapping a one-button window clicks it with this and does nothing on main, also with the pointer parked outside the window. unit tests pin the emulated call sequence for a second finger, a cancel and an unknown surface. only tried on one 1920x1080 scale 1 monitor, no physical touchscreen here.

part of #36.

bind wl_touch and feed the first touch point through the existing mouse path
(enter, press, move, release, leave), so buttons, sliders and the rest work on a
touchscreen without per-element changes. other fingers are ignored while one is
held.
@vaxerski
vaxerski merged commit d9aad2e into hyprwm:main Nov 13, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants