Merge branch 'onScreenKey test' into noWaterMark

# Conflicts:
#	Limelight/Input/ControllerSupport.m
This commit is contained in:
True Zhuanjia
2024-08-09 18:54:38 +08:00
10 changed files with 511 additions and 6 deletions
+14
View File
@@ -356,6 +356,7 @@ static const double MOUSE_SPEED_DIVISOR = 1.25;
NSLog(@"gamepadMask: %@", [self binaryRepresentationOfInteger:buttonFlags]); // we got the pressed OSC buttons here.
// Player 1 is always present for OSC
LiSendMultiControllerEvent(_multiController ? controller.playerIndex : 0, [self getActiveGamepadMask],
@@ -373,6 +374,19 @@ static const double MOUSE_SPEED_DIVISOR = 1.25;
}
}
- (NSString *)binaryRepresentationOfInteger:(int)number {
NSMutableString *binaryString = [NSMutableString string];
int numBits = sizeof(number) * 8;
for (int i = numBits - 1; i >= 0; i--) {
[binaryString appendString:((number >> i) & 1) ? @"1" : @"0"];
}
return binaryString;
}
+(BOOL) hasKeyboardOrMouse {
if (@available(iOS 14.0, tvOS 14.0, *)) {
return GCMouse.mice.count > 0 || GCKeyboard.coalescedKeyboard != nil;