Allow not capture mouse

This commit is contained in:
xzzpig
2024-11-29 23:00:54 +08:00
parent 589ca19e4f
commit 62ae63d7f6
17 changed files with 327 additions and 22 deletions
+10 -3
View File
@@ -48,6 +48,8 @@ static const double X1_MOUSE_SPEED_DIVISOR = 2.5;
double accumulatedMouseDeltaX;
double accumulatedMouseDeltaY;
int mouseMode;
UIResponder* touchHandler;
id<UserInteractionDelegate> interactionDelegate;
@@ -76,6 +78,8 @@ static const double X1_MOUSE_SPEED_DIVISOR = 2.5;
settings = [[[DataManager alloc] init] getSettings];
mouseMode = streamConfig.mouseMode;
keysDown = [[NSMutableSet alloc] init];
keyInputField = [[KeyboardInputField alloc] initWithFrame:CGRectZero];
[keyInputField setKeyboardType:UIKeyboardTypeDefault];
@@ -869,7 +873,7 @@ static const double X1_MOUSE_SPEED_DIVISOR = 2.5;
regionForRequest:(UIPointerRegionRequest *)request
defaultRegion:(UIPointerRegion *)defaultRegion API_AVAILABLE(ios(13.4)) {
if (@available(iOS 14.0, *)) {
if ([GCMouse current] != nil) {
if ([GCMouse current] != nil && mouseMode == 0) {
// We'll handle this with GCMouse. Do nothing here.
return nil;
}
@@ -897,8 +901,11 @@ static const double X1_MOUSE_SPEED_DIVISOR = 2.5;
}
- (UIPointerStyle *)pointerInteraction:(UIPointerInteraction *)interaction styleForRegion:(UIPointerRegion *)region API_AVAILABLE(ios(13.4)) {
// Always hide the mouse cursor over our stream view
return [UIPointerStyle hiddenPointerStyle];
if(mouseMode != 2){
return [UIPointerStyle hiddenPointerStyle];
}else{
return nil;
}
}
- (void)mouseWheelMovedContinuous:(UIPanGestureRecognizer *)gesture {