mirror of
https://github.com/babalae/better-genshin-impact.git
synced 2026-05-21 09:45:48 +08:00
@@ -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,
|
||||
|
||||
@@ -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>
|
||||
@@ -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);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user