问题
I observe that with the iMac magic mouse, while using the iPhone simulator, if:
a) the active view has an object in the center of the iPhone screen which is capable of generating touch events, and b) the iMac operator accidentally or otherwise drags their finger(s) across the magic mouse surface in a way which would normally be used for scrolling, that
the object in the center generates (bogus) mouse down and drag events.
If there is no such object in the center of the screen, there is no issue.
Is there a way to programmatically or otherwise disable this feature?
回答1:
This is actually an issue with all Mac input devices with scroll functionality. If you do a two-fingered scroll up and down on a Macbook touch pad the same thing happens.
I believe this is more or less "intended", though it appears the touch up event is lost - so sometimes the interface gets stuck after a scroll gesture. I don't know of a way to programmatically disable this feature, unfortunately :-/
回答2:
Gesture-based scrolling the iOS simulator was disabled sometime around iOS 4 or the iPad, I believe. It would have conflicted with the giant, scrolling window of the iOS simulator running on smaller screens.
来源:https://stackoverflow.com/questions/2087797/touch-events-with-magic-mouse-and-iphone-simulator