| Summary: | Finger motion outside of screen area not tracked when moving back inside on one side of device | ||
|---|---|---|---|
| Product: | SDL | Reporter: | christoph.boehler |
| Component: | events | Assignee: | Sam Lantinga <slouken> |
| Status: | ASSIGNED --- | QA Contact: | Sam Lantinga <slouken> |
| Severity: | minor | ||
| Priority: | P2 | CC: | amaranth72, christoph.boehler |
| Version: | 2.0.3 | ||
| Hardware: | iPhone/iPod touch | ||
| OS: | iOS (All) | ||
|
Description
christoph.boehler
2014-03-29 14:46:03 UTC
Does this work as expected for you in other non-SDL apps? Sorry for not testing this beforehand, but you're right, it seems to be innate to iOS. I will notify and slap the responsible authorities at apple :) thanks Ups, I've seemed to be a bit overzealous with my assessment. I've also tried another native iOS app (I've made myself without SDL) where the problem doesn't occur, so I guess by chance my other 2 tests from before were either (coincidentally) made with SDL too or just have the same problem. Overloading UIApplication's -(void)sendEvent:(UIEvent *)event correctly returns touch events in the above mentioned situations in my native iOS app. So the problem should be related to SDL. It's probably not really an issue on most apps, but since my app requires a lot of touches on the border it leads to some frustrating scenarios. Can you debug the SDL code and see what's happening? Thanks! Hello Sam, I found the culprit, though I'm not 100% sure why it's not working. Adding this to SDL_uikitview: > - (BOOL)pointInside:(CGPoint)point withEvent:(UIEvent *)event > { > NSLog(@"\nframe: %@\ntouchpoint: %@", NSStringFromCGRect(self.frame), NSStringFromCGPoint(point)); > return YES; > } touching somewhere close to the rightmost edge of the screen the logoutput results in: frame: {{0, 0}, {768, 1024}} touchpoint: {1012, 538.5} When calling [super pointInside...] I always get true unless coming from outside in. Touchpoint's x value will be 1024 in that case and I assume that either 1024 is considered outside or the rotation of the point causes a rounding problems? Those are my guesses anyways. Anyway, the simple solution would be to just add this to SDL_uikitview: > - (BOOL)pointInside:(CGPoint)point withEvent:(UIEvent *)event > { > return YES; > } Since the view always fills the entire screen. If that's not the case, let me know! That sounds fine to me. Where's the best place to put that in the file? Do you have to declare it as well? Insert into SDL_uikitview.m
- (BOOL)pointInside:(CGPoint)point withEvent:(UIEvent *)event
{
return YES;
}
I'm not sure if the declaration in the .h file is necessary since it's an overriden method, but it surely doesn't hurt.
I'm not sure what you mean with "best place", i'd say above the
- (CGPoint)touchLocation:(UITouch *)touch shouldNormalize:(BOOL)normalize;
method makes sense if that's what you mean.
|