tweak edge slide & touchHandler
This commit is contained in:
1 parent
d1ecc894b3
commit
5e40c9f9ad
5 files changed
+12
-10
No files matched your search
@@ -47,7 +47,7 @@
|
|||||||
self->streamView = view;
|
self->streamView = view;
|
||||||
|
|
||||||
// upper screen check
|
// upper screen check
|
||||||
EDGE_TOLERANCE = 15.0;
|
EDGE_TOLERANCE = 10.0;
|
||||||
slideGestureVerticalThreshold = CGRectGetHeight([[UIScreen mainScreen] bounds]) * 0.4;
|
slideGestureVerticalThreshold = CGRectGetHeight([[UIScreen mainScreen] bounds]) * 0.4;
|
||||||
screenWidthWithThreshold = CGRectGetWidth([[UIScreen mainScreen] bounds]) - EDGE_TOLERANCE;
|
screenWidthWithThreshold = CGRectGetWidth([[UIScreen mainScreen] bounds]) - EDGE_TOLERANCE;
|
||||||
self->touchPointSpawnedAtUpperScreenEdge = false;
|
self->touchPointSpawnedAtUpperScreenEdge = false;
|
||||||
|
|||||||
@@ -86,7 +86,7 @@
|
|||||||
|
|
||||||
self->pointerObjDict = [NSMutableDictionary dictionary];
|
self->pointerObjDict = [NSMutableDictionary dictionary];
|
||||||
|
|
||||||
EDGE_TOLERANCE = 15.0;
|
EDGE_TOLERANCE = 10.0;
|
||||||
slideGestureVerticalThreshold = CGRectGetHeight([[UIScreen mainScreen] bounds]) * 0.4;
|
slideGestureVerticalThreshold = CGRectGetHeight([[UIScreen mainScreen] bounds]) * 0.4;
|
||||||
screenWidthWithThreshold = CGRectGetWidth([[UIScreen mainScreen] bounds]) - EDGE_TOLERANCE;
|
screenWidthWithThreshold = CGRectGetWidth([[UIScreen mainScreen] bounds]) - EDGE_TOLERANCE;
|
||||||
|
|
||||||
@@ -190,7 +190,7 @@
|
|||||||
|
|
||||||
|
|
||||||
- (void)sendTouchEvent:(UITouch*)touch withTouchtype:(uint8_t)touchType{
|
- (void)sendTouchEvent:(UITouch*)touch withTouchtype:(uint8_t)touchType{
|
||||||
if(touchPointSpawnedAtUpperScreenEdge) return; // we're done here. this touch event will not be sent to the remote PC. and this must be checked after coord selector finishes populating new relative coords, or the app will crash!
|
if(touchPointSpawnedAtUpperScreenEdge && touchType != LI_TOUCH_EVENT_UP) return; // we're done here. this touch event will not be sent to the remote PC. and this must be checked after coord selector finishes populating new relative coords, or the app will crash
|
||||||
|
|
||||||
CGPoint targetCoords;
|
CGPoint targetCoords;
|
||||||
//NSLog(@"selecting coords: %d", touch.phase == UITouchPhaseMoved);
|
//NSLog(@"selecting coords: %d", touch.phase == UITouchPhaseMoved);
|
||||||
@@ -264,7 +264,8 @@
|
|||||||
[self removePointerId:touch]; //then remove pointerId
|
[self removePointerId:touch]; //then remove pointerId
|
||||||
if(self->activateCoordSelector) [self removePointerObjFromDict:touch];
|
if(self->activateCoordSelector) [self removePointerObjFromDict:touch];
|
||||||
}
|
}
|
||||||
if(self->touchPointSpawnedAtUpperScreenEdge && [[event allTouches] count] == [touches count]) self->touchPointSpawnedAtUpperScreenEdge = false; //bugbugbugbugbugbugbugbug
|
//if(self->touchPointSpawnedAtUpperScreenEdge && [[event allTouches] count] == [touches count])
|
||||||
|
self->touchPointSpawnedAtUpperScreenEdge = false;
|
||||||
});
|
});
|
||||||
else{
|
else{
|
||||||
for (UITouch* touch in touches){
|
for (UITouch* touch in touches){
|
||||||
|
|||||||
@@ -85,7 +85,7 @@
|
|||||||
|
|
||||||
self->pointerObjDict = [NSMutableDictionary dictionary];
|
self->pointerObjDict = [NSMutableDictionary dictionary];
|
||||||
|
|
||||||
EDGE_TOLERANCE = 15.0;
|
EDGE_TOLERANCE = 10.0;
|
||||||
slideGestureVerticalThreshold = CGRectGetHeight([[UIScreen mainScreen] bounds]) * 0.4;
|
slideGestureVerticalThreshold = CGRectGetHeight([[UIScreen mainScreen] bounds]) * 0.4;
|
||||||
screenWidthWithThreshold = CGRectGetWidth([[UIScreen mainScreen] bounds]) - EDGE_TOLERANCE;
|
screenWidthWithThreshold = CGRectGetWidth([[UIScreen mainScreen] bounds]) - EDGE_TOLERANCE;
|
||||||
|
|
||||||
@@ -189,7 +189,7 @@
|
|||||||
|
|
||||||
|
|
||||||
- (void)sendTouchEvent:(UITouch*)touch withTouchtype:(uint8_t)touchType{
|
- (void)sendTouchEvent:(UITouch*)touch withTouchtype:(uint8_t)touchType{
|
||||||
if(touchPointSpawnedAtUpperScreenEdge) return; // we're done here. this touch event will not be sent to the remote PC. and this must be checked after coord selector finishes populating new relative coords, or the app will crash!
|
if(touchPointSpawnedAtUpperScreenEdge && touchType != LI_TOUCH_EVENT_UP) return; // we're done here. this touch event will not be sent to the remote PC. and this must be checked after coord selector finishes populating new relative coords, or the app will crash
|
||||||
|
|
||||||
CGPoint targetCoords;
|
CGPoint targetCoords;
|
||||||
//NSLog(@"selecting coords: %d", touch.phase == UITouchPhaseMoved);
|
//NSLog(@"selecting coords: %d", touch.phase == UITouchPhaseMoved);
|
||||||
@@ -253,7 +253,7 @@
|
|||||||
[self removePointerId:touch]; //then remove pointerId
|
[self removePointerId:touch]; //then remove pointerId
|
||||||
if(self->activateCoordSelector) [self removePointerObjFromDict:touch];
|
if(self->activateCoordSelector) [self removePointerObjFromDict:touch];
|
||||||
}
|
}
|
||||||
if(self->touchPointSpawnedAtUpperScreenEdge && [[event allTouches] count] == [touches count]) self->touchPointSpawnedAtUpperScreenEdge = false;
|
self->touchPointSpawnedAtUpperScreenEdge = false;
|
||||||
});
|
});
|
||||||
else{
|
else{
|
||||||
for (UITouch* touch in touches){
|
for (UITouch* touch in touches){
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ static const float QUICK_TAP_TIME_INTERVAL = 0.2;
|
|||||||
mousePointerTimestamp = 0;
|
mousePointerTimestamp = 0;
|
||||||
|
|
||||||
// upper screen check
|
// upper screen check
|
||||||
EDGE_TOLERANCE = 15.0;
|
EDGE_TOLERANCE = 10.0;
|
||||||
slideGestureVerticalThreshold = CGRectGetHeight([[UIScreen mainScreen] bounds]) * 0.4;
|
slideGestureVerticalThreshold = CGRectGetHeight([[UIScreen mainScreen] bounds]) * 0.4;
|
||||||
screenWidthWithThreshold = CGRectGetWidth([[UIScreen mainScreen] bounds]) - EDGE_TOLERANCE;
|
screenWidthWithThreshold = CGRectGetWidth([[UIScreen mainScreen] bounds]) - EDGE_TOLERANCE;
|
||||||
self->touchPointSpawnedAtUpperScreenEdge = false;
|
self->touchPointSpawnedAtUpperScreenEdge = false;
|
||||||
@@ -238,8 +238,9 @@ static const float QUICK_TAP_TIME_INTERVAL = 0.2;
|
|||||||
touchLockedForMouseMove = nil;
|
touchLockedForMouseMove = nil;
|
||||||
mousePointerMoved = false; // need to reset this anyway
|
mousePointerMoved = false; // need to reset this anyway
|
||||||
[self resetAllPressedFlagsForOnScreenWidgetViews]; // reset all pressed flag for on-screen widget views after all fingers lifted from screen.
|
[self resetAllPressedFlagsForOnScreenWidgetViews]; // reset all pressed flag for on-screen widget views after all fingers lifted from screen.
|
||||||
touchPointSpawnedAtUpperScreenEdge = false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
touchPointSpawnedAtUpperScreenEdge = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ static CGFloat screenWidthInPoints;
|
|||||||
self = [super initWithTarget:target action:action];
|
self = [super initWithTarget:target action:action];
|
||||||
screenWidthInPoints = CGRectGetWidth([UIApplication.sharedApplication.windows.firstObject.screen bounds]); // Get the screen's bounds (in points)
|
screenWidthInPoints = CGRectGetWidth([UIApplication.sharedApplication.windows.firstObject.screen bounds]); // Get the screen's bounds (in points)
|
||||||
_immediateTriggering = false;
|
_immediateTriggering = false;
|
||||||
_EDGE_TOLERANCE = 15.0f;
|
_EDGE_TOLERANCE = 10.0f;
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user