I'd like to use two panels with a different handling of the touch events on the same page:
- The first panel uses the MultiTouch implementation from here https://www.b4x.com/android/forum/threads/multitouch-event.87027/ .
- The second panel should use the standard touch event.
At the moment, the MultiTouch code replaces the standard touch events for all panels. Erel mentions in the post above that the standard touch event should be raised if multipleTouchEnabled is set to False. I tried to change the code but my knowledge of Objective-C is practically zero.
Any help would be greatly appreciated!
This is the OBJC code:
- The first panel uses the MultiTouch implementation from here https://www.b4x.com/android/forum/threads/multitouch-event.87027/ .
- The second panel should use the standard touch event.
At the moment, the MultiTouch code replaces the standard touch events for all panels. Erel mentions in the post above that the standard touch event should be raised if multipleTouchEnabled is set to False. I tried to change the code but my knowledge of Objective-C is practically zero.
Any help would be greatly appreciated!
This is the OBJC code:
Objective-C:
#if OBJC
- (NSArray*)UITouchToPoint:(UITouch*)t :(UIView*)view {
CGPoint p = [t locationInView:view];
return @[@(p.x), @(p.y)];
}
@end
@implementation B4IPanelView (override)
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
if ([B4IObjectWrapper raiseEvent:self :@"_multitouchbegan:" :@[[touches allObjects]]] == false)
[super touchesMoved:touches withEvent:event];
}
- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event {
if ([B4IObjectWrapper raiseEvent:self :@"_multitouchmoved:" :@[[touches allObjects]]] == false)
[super touchesMoved:touches withEvent:event];
}
- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event {
if ([B4IObjectWrapper raiseEvent:self :@"_multitouchended:" :@[[touches allObjects]]] == false)
[super touchesMoved:touches withEvent:event];
}
#End If