From 2709a5e9468bf753fa0c693be33d79270f8e863f Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Fri, 19 Jul 2013 21:03:28 +0000 Subject: [PATCH] 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." --- src/osgViewer/GraphicsWindowIOS.mm | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/osgViewer/GraphicsWindowIOS.mm b/src/osgViewer/GraphicsWindowIOS.mm index c0ac226d5..c4cf370d0 100644 --- a/src/osgViewer/GraphicsWindowIOS.mm +++ b/src/osgViewer/GraphicsWindowIOS.mm @@ -587,6 +587,7 @@ typedef std::map TouchPointsIdMapping; } } + [super touchesBegan:touches withEvent:event]; } - (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event { @@ -607,9 +608,9 @@ typedef std::map TouchPointsIdMapping; } else { 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 @@ -630,8 +631,9 @@ typedef std::map TouchPointsIdMapping; } else { 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