Append submitted Android text on desktop
This commit is contained in:
@@ -22,7 +22,7 @@ public sealed class SyncMessageHandler
|
||||
remoteText += insertedText;
|
||||
break;
|
||||
case SyncAction.ReplaceAll:
|
||||
ReplaceAll(message.Text ?? string.Empty);
|
||||
AppendSubmittedText(message.Text ?? string.Empty);
|
||||
break;
|
||||
case SyncAction.Backspace:
|
||||
keyboard.Backspace();
|
||||
@@ -43,17 +43,15 @@ public sealed class SyncMessageHandler
|
||||
}
|
||||
}
|
||||
|
||||
private void ReplaceAll(string newText)
|
||||
private void AppendSubmittedText(string text)
|
||||
{
|
||||
if (newText == remoteText)
|
||||
if (string.IsNullOrEmpty(text))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
AppLogger.Info(
|
||||
$"Hard replacing focused text. Old mirrored length: {remoteText.Length}, new length: {newText.Length}");
|
||||
|
||||
keyboard.ReplaceFocusedText(newText);
|
||||
remoteText = newText;
|
||||
AppLogger.Info($"Appending submitted text length: {text.Length}");
|
||||
keyboard.InsertText(text);
|
||||
remoteText += text;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user