Comments (3)
For a comparison, on the iPad I see the following event when do release a single finger in two-finger gesture:
<UITouchesEvent: 0x28231e970> timestamp: 7343.81 touches: {(
<UITouch: 0x10571a400> phase: Ended tap count: 0 force: 0.000 window: <UIWindow: 0x104009c20; frame = (0 0; 1024 768); gestureRecognizers = <NSArray: 0x281671ec0>; layer = <UIWindowLayer: 0x281671d10>> responder: (null) ,
<UITouch: 0x105624910> phase: Stationary tap count: 1 force: 0.000 window: <UIWindow: 0x104009c20; frame = (0 0; 1024 768); gestureRecognizers = <NSArray: 0x281671ec0>; layer = <UIWindowLayer: 0x281671d10>> responder: (null)
)}
With the Hammer
simulation:
<UITouchesEvent: 0x60000331a490> timestamp: 178538 touches: {(
<UITouch: 0x1288461a0> phase: Ended tap count: 0 force: 0.000 window: <MBXFingerTipWindow: 0x11fe07840; baseClass = UIWindow; frame = (0 0; 1133 744); gestureRecognizers = <NSArray: 0x60000066a6d0>; layer = <UIWindowLayer: 0x60000066a520>> responder: (null) ,
<UITouch: 0x128838560> phase: Ended tap count: 0 force: 0.000 window: <MBXFingerTipWindow: 0x11fe07840; baseClass = UIWindow; frame = (0 0; 1133 744); gestureRecognizers = <NSArray: 0x60000066a6d0>; layer = <UIWindowLayer: 0x60000066a520>> responder: <MTKView: 0x12981e400; frame = (0 0; 1133 744); layer = <CAMetalLayer: 0x600000666e80>> location in window: {200, 400} previous location in window: {200, 400} location in view: {200, 400} previous location in view: {200, 400}
)}
It seems that Hammer have to simulate still active touches with stationary
phase and not to ignore them.
from hammer.
My early investigation results represents that sending only .stationary
phased touches in the fingerUp
method is the correct way to fix the issue and preserve existing functionality.
POC implementation:
public func fingerUp(_ indices: [FingerIndex?] = .automatic) throws {
let indices = try self.fillExistingFingerIndices(indices, withMinimum: 1)
let endingFingers = self.activeTouches.fingers.map { finger in
return FingerInfo(fingerIndex: finger.fingerIndex,
location: finger.location,
phase: indices.contains(finger.fingerIndex) ? .ended : .stationary,
pressure: 0, twist: 0, majorRadius: kDefaultRadius, minorRadius: kDefaultRadius)
}
try self.sendEvent(hand: HandInfo(fingers: endingFingers.filter({ $0.phase == .stationary })))
}
from hammer.
From the production-ready implementation it would be a challenge to correctly remove ended touches as we do report only the stationary one so no downstream code for cleanup would be called.
from hammer.
Related Issues (14)
- having trouble interacting with the callout bar HOT 8
- Question: Watch Support HOT 3
- Working with SwiftUI Lists? HOT 2
- Unable to access private API in UIWindow: "ContextID" HOT 8
- Hammer fails to build with Xcode 13 beta 4 HOT 3
- viewIsVisible Implementation Incorrect HOT 6
- How to use in Objective-c project HOT 2
- Xcode 13.3 can't compile Hammer 0.14.0 HOT 3
- New console log warnings and suggestions on flaky tests? HOT 2
- SFSafariViewController support
- Tests are only failing in remote CI pipeline. HOT 2
- waitUntilHittable never waits? HOT 1
- cocoapods support? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hammer.