mirror of
https://github.com/moonlight-stream/moonlight-ios.git
synced 2025-07-01 15:26:11 +00:00
parent
b20079a165
commit
a2f470ddeb
@ -22,6 +22,7 @@ static const double X1_MOUSE_SPEED_DIVISOR = 2.5;
|
||||
|
||||
KeyboardInputField* keyInputField;
|
||||
BOOL isInputingText;
|
||||
NSMutableSet* keysDown;
|
||||
|
||||
float streamAspectRatio;
|
||||
|
||||
@ -53,6 +54,7 @@ static const double X1_MOUSE_SPEED_DIVISOR = 2.5;
|
||||
|
||||
TemporarySettings* settings = [[[DataManager alloc] init] getSettings];
|
||||
|
||||
keysDown = [[NSMutableSet alloc] init];
|
||||
keyInputField = [[KeyboardInputField alloc] initWithFrame:CGRectZero];
|
||||
[keyInputField setKeyboardType:UIKeyboardTypeDefault];
|
||||
[keyInputField setAutocorrectionType:UITextAutocorrectionTypeNo];
|
||||
@ -424,8 +426,10 @@ static const double X1_MOUSE_SPEED_DIVISOR = 2.5;
|
||||
if (isToggleable){
|
||||
if (isOn){
|
||||
LiSendKeyboardEvent(keyCode, KEY_ACTION_DOWN, 0);
|
||||
[keysDown addObject:@(keyCode)];
|
||||
} else {
|
||||
LiSendKeyboardEvent(keyCode, KEY_ACTION_UP, 0);
|
||||
[keysDown removeObject:@(keyCode)];
|
||||
}
|
||||
}
|
||||
else {
|
||||
@ -765,6 +769,13 @@ static const double X1_MOUSE_SPEED_DIVISOR = 2.5;
|
||||
return NO;
|
||||
}
|
||||
|
||||
- (void)textFieldDidEndEditing:(UITextField *)textField {
|
||||
for (NSNumber* keyCode in keysDown) {
|
||||
LiSendKeyboardEvent([keyCode shortValue], KEY_ACTION_UP, 0);
|
||||
}
|
||||
[keysDown removeAllObjects];
|
||||
}
|
||||
|
||||
- (void)onKeyboardPressed:(UITextField *)textField {
|
||||
NSString* inputText = textField.text;
|
||||
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0), ^{
|
||||
|
Loading…
x
Reference in New Issue
Block a user