In my latest app Loopy Tunes, I needed to add multitouch functionality to a keyboard. I use Cocos2D, so if you’re like me, then just do the following.
In your delegate.m class, add this line
[glView setMultipleTouchEnabled:YES];
right after this one.
[director setOpenGLView:glView];
Then in your class.m where you are testing for multitouch, up in your init method, add the following line
self.isTouchEnabled = YES;
And then add your touch method somewhere down under the init method, just update the values of the areaToCheck
- (void)ccTouchesBegan:(NSSet*)touches withEvent:(UIEvent*)event
{
NSSet *allTouches = [event allTouches];
for (UITouch* touch in allTouches) {
CGPoint location = [touch locationInView:[touch view]];
location = [[CCDirector sharedDirector] convertToGL:location];
CGRect areaToCheck = CGRectMake(100,100,100,100);
if(CGRectContainsPoint(areaToCheck, location)) {
// whatever you want to happen here
}
}
}