Is it possible to detect which hand chirality that executed a gesture?
For example,
TapGesture(count: 2)
.targetedToAnyEntity()
.onEnded { value in
// if left hand
// do something
// if right hand
// do something
}
2
Answers
I do not think SwiftUI offers that information as of visionOS 1.1. You’ll need to use ARKit’s hand tracking APIs if you want to know which hand is gesturing. It will be a substantial amount of work. Start with the ARKit in visionOS documentation and check out the
HandTrackingProvider
class.With VisionOS 2 it will be possible using Compositor-Services
https://developer.apple.com/documentation/visionos-release-notes/visionos-2-release-notes#Compositor-Services
SpatialEventGesture