fix key mouse

This commit is contained in:
辉鸭蛋 2024-12-29 17:08:08 +08:00
parent 2b658afad6
commit 6432ff1aed
4 changed files with 10 additions and 5 deletions

View File

@ -60,7 +60,7 @@ public class KeyMouseMacroPlayer
var timeToWait = e.Time - (Kernel32.GetTickCount() - startTime);
if (timeToWait < 0)
{
TaskControl.Logger.LogWarning("无法原速重放事件{Event},落后{TimeToWait}ms", e.Type.ToString(), -timeToWait);
TaskControl.Logger.LogDebug("无法原速重放事件{Event},落后{TimeToWait}ms", e.Type.ToString(), (-timeToWait).ToString("F0"));
}
else
{

View File

@ -35,6 +35,11 @@ public class KeyMouseRecorder
public string ToJsonMacro()
{
// MacroEvents 需要以实际时间进行排序
MacroEvents.Sort((a, b) => a.Time.CompareTo(b.Time));
// 删除为负数的时间
MacroEvents.RemoveAll(m => m.Time < 0);
var rect = TaskContext.Instance().SystemInfo.CaptureAreaRect;
// 合并鼠标移动事件
var mergedMacroEvents = new List<MacroEvent>();
@ -189,7 +194,7 @@ public class KeyMouseRecorder
Type = MacroEventType.MouseMoveBy,
MouseX = state.X,
MouseY = state.Y,
Time = time - 5,
Time = time - 5 - StartTime,
CameraOrientation = cao,
});
}

View File

@ -161,7 +161,7 @@ public class TpTask(CancellationToken ct)
ra1 = CaptureToRectArea();
}
currentZoomLevel = GetBigMapZoomLevel(ra1);
Logger.LogInformation($"当前缩放等级为{currentZoomLevel},地图移动过程中不要操作鼠标中键。");
Logger.LogInformation($"当前缩放等级为{currentZoomLevel:F},地图移动过程中不要操作鼠标中键。");
for (var i = 0; i < 3; i++)
{

View File

@ -274,7 +274,7 @@
</Grid>
<Grid Margin="16">
<!--<Grid Margin="16">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
@ -298,7 +298,7 @@
Grid.Column="1"
Margin="0,0,36,0"
IsChecked="{Binding Config.MaskWindowConfig.UseSubform, Mode=TwoWay}" />
</Grid>
</Grid>-->
</StackPanel>
</ui:CardExpander>