This enables you easily to observe global multitouch events on the trackpad (Built-In only).
I created this library to make MultitouchSupport.framework (Private Framework) easy to use.
This library refers the following frameworks very much. Special Thanks!
- Development with Xcode 15.2+
- swift-tools-version: 5.9
- Compatible with macOS 12.0+
$ sh build_framework.sh
App SandBox must be disabled to use OpenMultitouchSupport.
import OpenMultitouchSupport
import Combine
var cancellables = Set<AnyCancellable>()
let manager = OMSManager.shared()
manager.touchDataPublisher
.sink { touchData in
// ・・・
}
.store(in: &cancellables)
manager.startListening()
manager.stopListening()
struct OMSPosition {
var x: Float
var y: Float
}
struct OMSAxis {
var major: Float
var minor: Float
}
enum OMSState: String {
case notTouching
case starting
case hovering
case making
case touching
case breaking
case lingering
case leaving
}
struct OMSTouchData {
var id: Int32
var position: OMSPosition
var total: Float // total value of capacitance
var pressure: Float
var axis: OMSAxis
var angle: Float // finger angle
var density: Float // area density of capacitance
var state: OMSState
var timestamp: String
}