From Christian Ruzicka, "with the current touch implementation on iOS the touches are not forwarded to parent views because the base implementation is not called. Also see the "Best Practices" in the iOS documentation for event handling:
http://developer.apple.com/library/ios/#documentation/EventHandling/Conceptual/EventHandlingiPhoneOS/multitouch_background/multitouch_background.html "If you handle events in a subclass of any other UIKit responder class: - You do not have to implement all of the event handling methods. - In the methods you do implement, be sure to call the superclass implementation. For example, [super touchesBegan:touches withEvent:event]." I added the missing lines and tested it with OSG 3.1.9 and iOS SDK 6.1."
This commit is contained in:
parent
f21a1dc9ad
commit
4a2e1534d5
@ -587,6 +587,7 @@ typedef std::map<void*, unsigned int> TouchPointsIdMapping;
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[super touchesBegan:touches withEvent:event];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event {
|
- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event {
|
||||||
@ -607,9 +608,9 @@ typedef std::map<void*, unsigned int> TouchPointsIdMapping;
|
|||||||
} else {
|
} else {
|
||||||
osg_event->addTouchPoint(touch_id, [self convertTouchPhase: [touch phase]], pixelPos.x(), pixelPos.y());
|
osg_event->addTouchPoint(touch_id, [self convertTouchPhase: [touch phase]], pixelPos.x(), pixelPos.y());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[super touchesMoved:touches withEvent:event];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event
|
- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event
|
||||||
@ -630,8 +631,9 @@ typedef std::map<void*, unsigned int> TouchPointsIdMapping;
|
|||||||
} else {
|
} else {
|
||||||
osg_event->addTouchPoint(touch_id, [self convertTouchPhase: [touch phase]], pixelPos.x(), pixelPos.y(), [touch tapCount]);
|
osg_event->addTouchPoint(touch_id, [self convertTouchPhase: [touch phase]], pixelPos.x(), pixelPos.y(), [touch tapCount]);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[super touchesEnded:touches withEvent:event];
|
||||||
}
|
}
|
||||||
|
|
||||||
-(void) touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event
|
-(void) touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event
|
||||||
|
Loading…
Reference in New Issue
Block a user