Revert "测试代码"

This reverts commit d1fcb9c21d.
This commit is contained in:
辉鸭蛋
2025-01-19 19:35:16 +08:00
parent d1fcb9c21d
commit 58d79d5955
3 changed files with 4 additions and 36 deletions

View File

@@ -72,7 +72,7 @@ public class KeyMouseRecorderJsonLine
_consumerTask = Task.Run(async () => await ConsumeEventsAsync(_path));
}
public KeyMouseRecorderJsonLine Start()
{
StartTick = Kernel32.GetTickCount();
@@ -124,11 +124,6 @@ public class KeyMouseRecorderJsonLine
public void KeyDown(KeyEventArgsExt e)
{
var time = e.Timestamp - StartTick;
if (e.KeyCode == Keys.F)
{
TaskControl.Logger.LogInformation($"{DateTime.Now:HH:mm:ss.ffff}按下F");
}
AddEvent(_macroEventsChannel, new MacroEvent
{
Type = MacroEventType.KeyDown,
@@ -201,12 +196,12 @@ public class KeyMouseRecorderJsonLine
Time = time
});
}
public void MouseMoveBy(MouseState state, uint tick, bool save = false)
{
User32.GetCursorPos(out var p);
var mEvent = new MacroEvent
{
Type = MacroEventType.MouseMoveBy,

View File

@@ -510,8 +510,5 @@
<!--<ui:Button x:Name="Test" Margin="0,20,0,0" Content="测试" Command="{Binding TestCommand}" />-->
<TextBlock Name="ClockStartBlock">启动时间</TextBlock>
<TextBlock Name="ClockBlock">当前时间</TextBlock>
<TextBlock Name="TickBlock">tickCount</TextBlock>
</StackPanel>
</Page>

View File

@@ -1,7 +1,4 @@
using System;
using System.Threading.Tasks;
using BetterGenshinImpact.ViewModel.Pages;
using Vanara.PInvoke;
using BetterGenshinImpact.ViewModel.Pages;
namespace BetterGenshinImpact.View.Pages
{
@@ -15,27 +12,6 @@ namespace BetterGenshinImpact.View.Pages
InitializeComponent();
// hotKeyPageViewModel 放在这里是为了在首页就初始化热键
Task.Run(async () =>
{
bool first = true;
// 显示当前时间
while (true)
{
Dispatcher.Invoke(() =>
{
if (first)
{
first = false;
ClockStartBlock.Text = DateTime.Now.ToString("HH:mm:ss.fff") + " | " + Kernel32.GetTickCount().ToString();
}
ClockBlock.Text = DateTime.Now.ToString("HH:mm:ss.fff");
TickBlock.Text = Kernel32.GetTickCount().ToString();
});
await Task.Delay(10);
}
});
}
}
}