Skip to content

Deliver the panel's touch to every widget, plugins included - #26

Open
masonjmiller wants to merge 3 commits into
kemalandic:mainfrom
masonjmiller:native-touch
Open

masonjmiller wants to merge 3 commits into
kemalandic:mainfrom
masonjmiller:native-touch

Conversation

@masonjmiller

@masonjmiller masonjmiller commented Oct 8, 2026 •

Copy link
Copy Markdown

EdgeControl's own touch now reaches every widget, plugins included, so a XENEON EDGE needs no system-level touch driver alongside it. Closes #18, closes #19.

Why

Taps went only to native widgets' touch zones, so a plugin couldn't be touched at all (#19). The workaround was a system-wide touch driver that turns the panel into a mouse. That driver fights EdgeControl for the device, moves the pointer, and has to win a race at login. With it running, EdgeControl also paged the dashboard under a finger dragging a plugin's slider, because both were reading the same finger.

How

  • TouchGesture reads each touch the way such a driver does:
    • Tap: a finger that lifts before it moves or rests.
    • Swipe: one that moves within 300 ms and 8 points. Sideways it pages the dashboard, live, as before; up or down it scrolls.
    • Press: one that rests first. It presses what's under it and drags as it moves: a slider, a long press, a widget in edit mode.
  • Taps on native widgets still go to their touch zones. Everything else goes to the dashboard window through TouchEventInjector, as the events a mouse or trackpad would send:
    • Plugins get real clicks, presses, drags and scrolls, which WebKit treats as trusted.
    • Web views get scroll events. Native content scrolls by drag, as TouchScrollView expects.
    • Events go to the window directly: the pointer doesn't move, and EdgeControl doesn't come forward over the app being worked in.
  • Plugin views accept the first click (Plugin widgets ignore the first click when EdgeControl isn't the active app #18). Otherwise the first touch on a plugin while another app was in front only activated EdgeControl.
  • A widget's tile-wide widget-tap zone registers only when it has a job: in edit mode, or for a native widget with an Opens on Tap app. Over a plugin it took every tap and did nothing with it.
  • The panel's own coordinates map it, from its HID descriptor (0…16,383 by 0…9,599). The corner-dwell calibration had no settings screen and blocked touch until someone happened to hold a finger on each corner. It also skews the map, since a fingertip "in the corner" sits 30–40 points in. It now runs only when asked for (resetCalibration).
  • Contact comes from the touchscreen's own tip switch as well as the mouse interface's button.
  • Whole reports: a report's values arrive one at a time, contact before position, so a new touch was first seen where the last one ended. Samples are now passed on once the whole report is in.
  • Input Monitoring: seizing the panel's mouse interface needs it. Without it, macOS keeps treating the panel as a mouse and clicks wherever its pointer lands as well. When the seize is refused for want of permission, EdgeControl now asks for it once.

Testing

  • xcodebuild test passes in full: 394 Swift Testing tests in 38 suites, plus the XCTest suite. Seven are new, for TouchGesture and PanelMapping:

    • tap;
    • press and drag;
    • a rest the hold timer didn't get to;
    • paging;
    • scrolling;
    • jitter;
    • mapping corner to corner.
  • On a XENEON EDGE (macOS 27.2), with the system touch driver uninstalled and EdgeControl holding all three of the panel's interfaces (seize active (3/3)):

    • taps on native widgets and in a plugin;
    • a long press in a plugin opening a popup;
    • hold-and-drag on a plugin's slider without paging;
    • sideways swipes paging;
    • vertical swipes scrolling a plugin's list.

    Another app stayed in front throughout.

  • One thing to know for local builds: macOS ties Input Monitoring to the app's signature. An ad-hoc-signed build has to be added to the list by hand (Privacy & Security → Input Monitoring → +). A Developer ID build asks once.

Overlap

#22 adds a layer parameter to TouchTappable, and this PR adds enabled. Whichever lands second takes both; it's a three-line merge.

🤖 Generated with Claude Code

masonjmiller and others added 3 commits October 8, 2026 11:22
EdgeControl's own touch reached only native widgets with touch zones, so a
plugin on the dashboard couldn't be touched at all (kemalandic#19). The usual way
round it has been a system-level touch driver, which turns the panel into
a mouse, fights EdgeControl for the device, moves the pointer, and needs
its own login item to win the race at startup.

EdgeControl now does the driver's job itself, inside its own window:

- TouchGesture reads each touch the way such a driver does. A finger that
  lifts before it moves or rests is a tap. One that moves within 300 ms and
  8 points is a swipe: sideways it pages the dashboard as before, up or down
  it scrolls. One that rests first is a press, and drags as it moves.
- Taps on native widgets still go to their touch zones. Everything else
  goes to the dashboard window, through TouchEventInjector, as the mouse and
  scroll events a mouse or trackpad would send. A plugin gets a real click,
  press, drag and scroll, trusted by WebKit like any other. Native lists
  scroll by drag, as TouchScrollView expects; web views get scroll events.
- The events go to the window directly: the pointer doesn't move, and
  EdgeControl doesn't come forward over the app being worked in.
- Plugin views accept the first click (kemalandic#18). Without it the first touch on
  a plugin while another app was in front only activated EdgeControl.
- The panel's own coordinates map it, from its HID descriptor (0…16,383 by
  0…9,599 on a XENEON EDGE), so touch works without calibrating. The
  corner-dwell calibration had no settings screen and blocked touch until
  someone happened to hold a finger on each corner; it skews the map too,
  since a fingertip "in the corner" sits 30–40 points in. It now runs only
  when asked for.
- A report's values arrive one at a time, contact before position, so a new
  touch was first seen where the last one ended. Samples are now passed on
  once the whole report is in.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ring

Contact came only from the panel's mouse interface, which macOS lets an
app seize only with Input Monitoring. Without it, EdgeControl saw positions
from the touchscreen interface but never a finger down. The touchscreen's
own tip switch now counts as contact too.

And the mouse interface has to be seized, or macOS keeps treating the panel
as a mouse and clicks wherever its pointer lands as well. When the seize is
refused for want of permission, EdgeControl asks for Input Monitoring once.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Every widget tile has a touch zone, so a tap can select it in edit mode or
open its Opens on Tap app. Native widgets' own controls have smaller zones
that win. A plugin has none, so the tile's zone took every tap on it and,
with no app to open, did nothing. Now that touch reaches plugins, that zone
registers only in edit mode, or for a native widget with an app to open.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

EdgeControl's own touch input doesn't reach plugin widgets Plugin widgets ignore the first click when EdgeControl isn't the active app

1 participant