Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/Kyome22/OpenMultitouchSupport
This enables you easily to access raw data of the multitouch trackpad.
https://github.com/Kyome22/OpenMultitouchSupport
macos objective-c swift
Last synced: 3 months ago
JSON representation
This enables you easily to access raw data of the multitouch trackpad.
- Host: GitHub
- URL: https://github.com/Kyome22/OpenMultitouchSupport
- Owner: Kyome22
- License: mit
- Created: 2019-07-11T16:53:36.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2024-03-02T11:43:07.000Z (8 months ago)
- Last Synced: 2024-07-07T02:48:40.170Z (4 months ago)
- Topics: macos, objective-c, swift
- Language: Objective-C
- Homepage:
- Size: 189 KB
- Stars: 29
- Watchers: 2
- Forks: 7
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# OpenMultitouchSupport
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.## References
This library refers the following frameworks very much. Special Thanks!
- [mhuusko5/M5MultitouchSupport](https://github.com/mhuusko5/M5MultitouchSupport)
- [calftrail/Touch](https://github.com/calftrail/Touch/blob/master/TouchSynthesis/MultitouchSupport.h)## Requirements
- Development with Xcode 15.2+
- swift-tools-version: 5.9
- Compatible with macOS 12.0+## Demo
## Build OpenMultitouchSupportXCF.xcframework
```sh
$ sh build_framework.sh
```## Usage
App SandBox must be disabled to use OpenMultitouchSupport.
```swift
import OpenMultitouchSupport
import Combinevar cancellables = Set()
let manager = OMSManager.shared()
manager.touchDataPublisher
.sink { touchData in
// ・・・
}
.store(in: &cancellables)manager.startListening()
manager.stopListening()
```### The data you can get are as follows
```swift
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
}
```