mirror of
https://github.com/Stone-Red-Code/ClipCMD.git
synced 2026-09-09 07:46:11 +02:00
Fix AutoType not writing all text bug
This commit is contained in:
@@ -126,7 +126,7 @@ public partial class MainWindow : Window
|
|||||||
|
|
||||||
parser.SetDelimiters(" ");
|
parser.SetDelimiters(" ");
|
||||||
|
|
||||||
string[] sections = parser.ReadFields() ?? Array.Empty<string>();
|
string[] sections = parser.ReadFields() ?? [];
|
||||||
|
|
||||||
sections = sections.Select(s => s.Replace('\0', '\"')).ToArray();
|
sections = sections.Select(s => s.Replace('\0', '\"')).ToArray();
|
||||||
|
|
||||||
@@ -176,17 +176,24 @@ public partial class MainWindow : Window
|
|||||||
|
|
||||||
if (Settings.AutoPaste)
|
if (Settings.AutoPaste)
|
||||||
{
|
{
|
||||||
_ = inputSimulator.Keyboard.ModifiedKeyStroke(new[] { VirtualKeyCode.CONTROL }, new[] { VirtualKeyCode.VK_V });
|
_ = inputSimulator.Keyboard.ModifiedKeyStroke([VirtualKeyCode.CONTROL], [VirtualKeyCode.VK_V]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (Settings.Mode == ClipCMDMode.AutoType)
|
else if (Settings.Mode == ClipCMDMode.AutoType)
|
||||||
{
|
{
|
||||||
RuntimeData.AutoTypeRunning = true;
|
RuntimeData.AutoTypeRunning = true;
|
||||||
|
|
||||||
|
while (inputSimulator.InputDeviceState.IsKeyDown(VirtualKeyCode.CONTROL))
|
||||||
|
{
|
||||||
|
// Wait for CTRL key to be released
|
||||||
|
await Task.Delay(100);
|
||||||
|
}
|
||||||
|
|
||||||
foreach (char c in outText.ToString())
|
foreach (char c in outText.ToString())
|
||||||
{
|
{
|
||||||
_ = inputSimulator.Keyboard.TextEntry(c);
|
_ = inputSimulator.Keyboard.TextEntry(c);
|
||||||
await Task.Delay(Settings.AutoTypeDelay);
|
await Task.Delay(Settings.AutoTypeDelay);
|
||||||
|
|
||||||
if (!RuntimeData.AutoTypeRunning)
|
if (!RuntimeData.AutoTypeRunning)
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
@@ -236,7 +243,7 @@ public partial class MainWindow : Window
|
|||||||
|
|
||||||
private void StaticCommandsTextBox_TextChanged(object sender, System.Windows.Controls.TextChangedEventArgs e)
|
private void StaticCommandsTextBox_TextChanged(object sender, System.Windows.Controls.TextChangedEventArgs e)
|
||||||
{
|
{
|
||||||
string[] lines = RuntimeData.CommandsText.Split('\n').Append("[#END#]").ToArray();
|
string[] lines = [.. RuntimeData.CommandsText.Split('\n'), "[#END#]"];
|
||||||
string commandNames = string.Empty;
|
string commandNames = string.Empty;
|
||||||
StringBuilder script = new StringBuilder();
|
StringBuilder script = new StringBuilder();
|
||||||
|
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ public class RuntimeData : INotifyPropertyChanged
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public ObservableCollection<string> Errors { get; } = new();
|
public ObservableCollection<string> Errors { get; } = [];
|
||||||
|
|
||||||
public Visibility LogPanelVisible
|
public Visibility LogPanelVisible
|
||||||
{
|
{
|
||||||
@@ -71,7 +71,7 @@ public class RuntimeData : INotifyPropertyChanged
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public ObservableCollection<string> Logs { get; } = new();
|
public ObservableCollection<string> Logs { get; } = [];
|
||||||
|
|
||||||
public RuntimeData()
|
public RuntimeData()
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user