- optimize touch pad gesture
- relative touch minor fix
This commit is contained in:
1 parent
da4bfb851c
commit
ea68353328
2 files changed
+14
-7
No files matched your search
@@ -94,6 +94,7 @@ static const float QUICK_TAP_TIME_INTERVAL = 0.2;
|
|||||||
}
|
}
|
||||||
|
|
||||||
- (void)mouseRightClick {
|
- (void)mouseRightClick {
|
||||||
|
multiTouchesDetected = false;
|
||||||
dispatch_time_t delay = dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.1 * NSEC_PER_SEC));
|
dispatch_time_t delay = dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.1 * NSEC_PER_SEC));
|
||||||
dispatch_async(dispatch_get_global_queue(QOS_CLASS_USER_INTERACTIVE, 0), ^{
|
dispatch_async(dispatch_get_global_queue(QOS_CLASS_USER_INTERACTIVE, 0), ^{
|
||||||
LiSendMouseButtonEvent(BUTTON_ACTION_PRESS, BUTTON_RIGHT);
|
LiSendMouseButtonEvent(BUTTON_ACTION_PRESS, BUTTON_RIGHT);
|
||||||
@@ -160,7 +161,7 @@ static const float QUICK_TAP_TIME_INTERVAL = 0.2;
|
|||||||
}
|
}
|
||||||
quickTapTouch = touches.anyObject;
|
quickTapTouch = touches.anyObject;
|
||||||
}
|
}
|
||||||
|
|
||||||
// use [event allTouches] to check if touchLockedForMouseMove is captured, if already captured, don't update touchLockedForMouseMove
|
// use [event allTouches] to check if touchLockedForMouseMove is captured, if already captured, don't update touchLockedForMouseMove
|
||||||
if(candidateTouch != nil && ![[event allTouches] containsObject:touchLockedForMouseMove]){
|
if(candidateTouch != nil && ![[event allTouches] containsObject:touchLockedForMouseMove]){
|
||||||
touchLockedForMouseMove = candidateTouch;
|
touchLockedForMouseMove = candidateTouch;
|
||||||
@@ -175,7 +176,7 @@ static const float QUICK_TAP_TIME_INTERVAL = 0.2;
|
|||||||
NSSet* currentTouches = [UITouchUtil touchesIn:streamView from:event];
|
NSSet* currentTouches = [UITouchUtil touchesIn:streamView from:event];
|
||||||
|
|
||||||
if(![self isOnScreenControllerBeingPressed:currentTouches]) [TouchPadGestureHandler handleGestureIn:streamView with:event];
|
if(![self isOnScreenControllerBeingPressed:currentTouches]) [TouchPadGestureHandler handleGestureIn:streamView with:event];
|
||||||
|
|
||||||
if(multiTouchesDetected) return;
|
if(multiTouchesDetected) return;
|
||||||
|
|
||||||
if([touches containsObject:touchLockedForMouseMove]){
|
if([touches containsObject:touchLockedForMouseMove]){
|
||||||
@@ -192,13 +193,18 @@ static const float QUICK_TAP_TIME_INTERVAL = 0.2;
|
|||||||
|
|
||||||
if(TouchPadGestureHandler.ctrlDown) LiSendKeyboardEvent(CommandManager.keyboardButtonMappings[@"CTRL"].shortValue,KEY_ACTION_UP,0);
|
if(TouchPadGestureHandler.ctrlDown) LiSendKeyboardEvent(CommandManager.keyboardButtonMappings[@"CTRL"].shortValue,KEY_ACTION_UP,0);
|
||||||
|
|
||||||
|
NSLog(@"testtttttt %lu, %lu, %f",[UITouchUtil touchesIn:streamView from:event].count, touches.count, CACurrentMediaTime());
|
||||||
|
NSLog(@"testtttttt666 %lu, %lu, %f",[event allTouches].count, touches.count, CACurrentMediaTime());
|
||||||
|
|
||||||
|
|
||||||
if(multiTouchesDetected){
|
if(multiTouchesDetected){
|
||||||
if([UITouchUtil touchesIn:streamView from:event].count == touches.count) multiTouchesDetected = false;
|
if([UITouchUtil touchesIn:streamView from:event].count == touches.count){
|
||||||
|
|
||||||
|
multiTouchesDetected = false;}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if([UITouchUtil touchesIn:streamView from:event].count == touches.count) multiTouchesDetected = false;
|
if([UITouchUtil touchesIn:streamView from:event].count == touches.count) multiTouchesDetected = false;
|
||||||
|
|
||||||
if([touches containsObject:touchLockedForMouseMove]){
|
if([touches containsObject:touchLockedForMouseMove]){
|
||||||
// dealing with a single first tap, whether the button will be released, is going to be decided in sendLongMouseLeftButtonClickEvent
|
// dealing with a single first tap, whether the button will be released, is going to be decided in sendLongMouseLeftButtonClickEvent
|
||||||
if(!mousePointerMoved && !self->quickTapDetected) [self sendLongMouseLeftButtonClickEvent];
|
if(!mousePointerMoved && !self->quickTapDetected) [self sendLongMouseLeftButtonClickEvent];
|
||||||
|
|||||||
@@ -33,13 +33,14 @@ import UIKit
|
|||||||
let midPointDeltaY = UITouchUtil.midPointDeltaY(between: touch1, and: touch2, in: view)
|
let midPointDeltaY = UITouchUtil.midPointDeltaY(between: touch1, and: touch2, in: view)
|
||||||
let midPointDeltaX = UITouchUtil.midPointDeltaX(between: touch1, and: touch2, in: view)
|
let midPointDeltaX = UITouchUtil.midPointDeltaX(between: touch1, and: touch2, in: view)
|
||||||
|
|
||||||
let pinchDelta = enablePinch ? (currentDistance-previousDistance)*7*pinchSensitivity : 0;
|
let originalPinchDelta = currentDistance-previousDistance;
|
||||||
|
let pinchDelta = enablePinch ? originalPinchDelta*7*pinchSensitivity : 0;
|
||||||
LiSendHighResScrollEvent(Int16(pinchDelta + midPointDeltaY*7*scrollSensitivity))
|
LiSendHighResScrollEvent(Int16(pinchDelta + midPointDeltaY*7*scrollSensitivity))
|
||||||
if enableHorizontalScroll {LiSendHighResHScrollEvent(Int16(-midPointDeltaX*7*scrollSensitivity))}
|
if enableHorizontalScroll {LiSendHighResHScrollEvent(Int16(-midPointDeltaX*7*scrollSensitivity))}
|
||||||
|
|
||||||
if !enablePinch || !ctrlDownForPinch {return};
|
if !enablePinch || !ctrlDownForPinch {return};
|
||||||
|
|
||||||
if abs(currentDistance - previousDistance) > abs(midPointDeltaY) {
|
if abs(originalPinchDelta) > abs(midPointDeltaY)*1.3, abs(originalPinchDelta) > abs(midPointDeltaX)*1.3 {
|
||||||
LiSendKeyboardEvent(CommandManager.keyboardButtonMappings["CTRL"]!, CChar(KEY_ACTION_DOWN), 0)
|
LiSendKeyboardEvent(CommandManager.keyboardButtonMappings["CTRL"]!, CChar(KEY_ACTION_DOWN), 0)
|
||||||
ctrlDown = true
|
ctrlDown = true
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in new issue
Block a user