# kyome22/openmultitouchsupport architecture

> Architecture diagram of the GitHub repository kyome22/openmultitouchsupport, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-06). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/kyome22/openmultitouchsupport
- Repository: https://github.com/kyome22/openmultitouchsupport

## Overview

OpenMultitouchSupport is a macOS library for observing global trackpad multitouch events and consuming them as an asynchronous stream of Sendable touch data. The main workflow is: an app starts the shared manager, the manager registers for native events, converts each frame into the public touch-data model, and publishes it for the app to iterate. The native bridge is a binary framework, so its internal capture implementation is not visible in the supplied excerpts; edges are limited to the manager’s shown calls and documented usage.

Main entry points: [`Sources/OpenMultitouchSupport/OMSManager.swift`](https://github.com/kyome22/openmultitouchsupport/blob/main/Sources/OpenMultitouchSupport/OMSManager.swift) (OMS Manager), [`Framework/OpenMultitouchSupportXCF/OpenMTManager.h`](https://github.com/kyome22/openmultitouchsupport/blob/main/Framework/OpenMultitouchSupportXCF/OpenMTManager.h) (Native manager), [`Framework/OpenMultitouchSupportXCF/OpenMTEvent.h`](https://github.com/kyome22/openmultitouchsupport/blob/main/Framework/OpenMultitouchSupportXCF/OpenMTEvent.h) (Touch event), [`Sources/OpenMultitouchSupport/AsyncStreamBundle.swift`](https://github.com/kyome22/openmultitouchsupport/blob/main/Sources/OpenMultitouchSupport/AsyncStreamBundle.swift) (Async stream bundle)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["Public API"]
  node_manager["OMS Manager<br/>[OMSManager.swift]"]
end

subgraph group_capture["Native Capture"]
  node_native["Native manager<br/>[OpenMTManager.h]"]
  node_event["Touch event<br/>[OpenMTEvent.h]"]
  node_touch["Native touch<br/>[OpenMTTouch.h]"]
end

subgraph group_stream["Stream and Data"]
  node_model["Touch data model<br/>[OMSTouchData.swift]"]
  node_bundle["Async stream bundle"]
end

node_app(("Consuming app"))
node_trackpad(("Default trackpad"))

node_app -->|"starts listening"| node_manager
node_manager -->|"registers listener"| node_native
node_trackpad -.->|"provides touch events"| node_native
node_native -.->|"dispatches event"| node_event
node_manager -->|"handles event"| node_event
node_manager -->|"reads touch fields"| node_touch
node_manager -->|"converts touches"| node_model
node_manager -->|"sends touch arrays"| node_bundle
node_app -->|"iterates stream"| node_manager
node_manager -->|"exposes stream"| node_bundle

click node_manager "https://github.com/kyome22/openmultitouchsupport/blob/main/Sources/OpenMultitouchSupport/OMSManager.swift"
click node_native "https://github.com/kyome22/openmultitouchsupport/blob/main/Framework/OpenMultitouchSupportXCF/OpenMTManager.h"
click node_event "https://github.com/kyome22/openmultitouchsupport/blob/main/Framework/OpenMultitouchSupportXCF/OpenMTEvent.h"
click node_touch "https://github.com/kyome22/openmultitouchsupport/blob/main/Framework/OpenMultitouchSupportXCF/OpenMTTouch.h"
click node_model "https://github.com/kyome22/openmultitouchsupport/blob/main/Sources/OpenMultitouchSupport/OMSTouchData.swift"
click node_bundle "https://github.com/kyome22/openmultitouchsupport/blob/main/Sources/OpenMultitouchSupport/AsyncStreamBundle.swift"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_manager toneBlue
class node_native,node_event,node_touch toneAmber
class node_model,node_bundle toneMint
class node_app,node_trackpad toneIndigo
```

## Components

### Public API

- [OMS Manager](https://github.com/kyome22/openmultitouchsupport/blob/main/Sources/OpenMultitouchSupport/OMSManager.swift): `Sources/OpenMultitouchSupport/OMSManager.swift`

### Native Capture

- [Native manager](https://github.com/kyome22/openmultitouchsupport/blob/main/Framework/OpenMultitouchSupportXCF/OpenMTManager.h): `Framework/OpenMultitouchSupportXCF/OpenMTManager.h`
- [Touch event](https://github.com/kyome22/openmultitouchsupport/blob/main/Framework/OpenMultitouchSupportXCF/OpenMTEvent.h): `Framework/OpenMultitouchSupportXCF/OpenMTEvent.h`
- [Native touch](https://github.com/kyome22/openmultitouchsupport/blob/main/Framework/OpenMultitouchSupportXCF/OpenMTTouch.h): `Framework/OpenMultitouchSupportXCF/OpenMTTouch.h`

### Stream and Data

- [Touch data model](https://github.com/kyome22/openmultitouchsupport/blob/main/Sources/OpenMultitouchSupport/OMSTouchData.swift): `Sources/OpenMultitouchSupport/OMSTouchData.swift`
- [Async stream bundle](https://github.com/kyome22/openmultitouchsupport/blob/main/Sources/OpenMultitouchSupport/AsyncStreamBundle.swift): `Sources/OpenMultitouchSupport/AsyncStreamBundle.swift`

### Other components

- **Consuming app**
- **Default trackpad**

## Connections

- Consuming app → OMS Manager: starts listening (evidence: `README.md`)
- OMS Manager → Native manager: registers listener (evidence: `Sources/OpenMultitouchSupport/OMSManager.swift`)
- Default trackpad → Native manager: provides touch events
- Native manager → Touch event: dispatches event
- OMS Manager → Touch event: handles event (evidence: `Sources/OpenMultitouchSupport/OMSManager.swift`)
- OMS Manager → Native touch: reads touch fields (evidence: `Sources/OpenMultitouchSupport/OMSManager.swift`)
- OMS Manager → Touch data model: converts touches (evidence: `Sources/OpenMultitouchSupport/OMSManager.swift`)
- OMS Manager → Async stream bundle: sends touch arrays (evidence: `Sources/OpenMultitouchSupport/OMSManager.swift`)
- Consuming app → OMS Manager: iterates stream (evidence: `README.md`)
- OMS Manager → Async stream bundle: exposes stream (evidence: `Sources/OpenMultitouchSupport/OMSManager.swift`)
