feat(POE-AutoFlask): 实现自定义按键输入功能
- 新增自定义按键输入界面和逻辑 - 添加按键转换和去重功能 - 优化现有按键设置界面布局 - 更新应用图标
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@ -3,3 +3,4 @@ dist
|
||||
.venv
|
||||
PyQt-Fluent-Widgets
|
||||
.idea
|
||||
POE-AutoFlask/POE-AutoFlask/bin
|
||||
|
||||
@ -1,2 +1,6 @@
|
||||
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AForm_002Ecs_002Fl_003AC_0021_003FUsers_003FAdministrator_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FSourcesCache_003Fea4e26b838fa1efe7191739c1dfa5a1eb085bb31e6aa725759b9f49e1b_003FForm_002Ecs/@EntryIndexedValue">ForceIncluded</s:String></wpf:ResourceDictionary>
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AForm_002Ecs_002Fl_003AC_0021_003FUsers_003FAdministrator_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FSourcesCache_003Fea4e26b838fa1efe7191739c1dfa5a1eb085bb31e6aa725759b9f49e1b_003FForm_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AKeys_002Ecs_002Fl_003AC_0021_003FUsers_003FAdministrator_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F1f2f0b08d2574f1aa35973d1cd0ae347cef920_003Fcd_003F653168c5_003FKeys_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AMarshal_002Ecs_002Fl_003AC_0021_003FUsers_003FAdministrator_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F211e6f3b24fa438a92f1815153647ce2c8f908_003Fbd_003Fa484ba8f_003FMarshal_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AMessageBox_002Ecs_002Fl_003AC_0021_003FUsers_003FAdministrator_003FAppData_003FLocal_003FSymbols_003Fsrc_003Fdotnet_003Fwinforms_003Fe4efded416f8216935683d9a12e2eb45df78a728_003Fsrc_003FSystem_002EWindows_002EForms_003Fsrc_003FSystem_003FWindows_003FForms_003FMessageBox_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ANativeWindow_002Ecs_002Fl_003AC_0021_003FUsers_003FAdministrator_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FSourcesCache_003Fde7e5d9f3eff8e93316bbae6f9743ff9f72884862e5d612aaaba84bf9aa3a8_003FNativeWindow_002Ecs/@EntryIndexedValue">ForceIncluded</s:String></wpf:ResourceDictionary>
|
||||
87
POE-AutoFlask/POE-AutoFlask/MainForm.Designer.cs
generated
87
POE-AutoFlask/POE-AutoFlask/MainForm.Designer.cs
generated
@ -39,10 +39,8 @@ partial class MainForm
|
||||
checkbox2 = new AntdUI.Checkbox();
|
||||
checkbox1 = new AntdUI.Checkbox();
|
||||
groupBox2 = new System.Windows.Forms.GroupBox();
|
||||
StartLabel = new AntdUI.Label();
|
||||
input1 = new AntdUI.Input();
|
||||
SetStartButton = new AntdUI.Button();
|
||||
CustomKeysLabel = new AntdUI.Label();
|
||||
SetCustomButton = new AntdUI.Button();
|
||||
inputNumber1 = new AntdUI.InputNumber();
|
||||
label2 = new AntdUI.Label();
|
||||
select2 = new AntdUI.Select();
|
||||
@ -96,7 +94,7 @@ partial class MainForm
|
||||
//
|
||||
label33.AutoSizeMode = AntdUI.TAutoSize.Auto;
|
||||
label33.Font = new System.Drawing.Font("Microsoft YaHei UI", 10F);
|
||||
label33.Location = new System.Drawing.Point(14, 81);
|
||||
label33.Location = new System.Drawing.Point(14, 85);
|
||||
label33.Name = "label33";
|
||||
label33.Size = new System.Drawing.Size(111, 17);
|
||||
label33.TabIndex = 11;
|
||||
@ -110,7 +108,7 @@ partial class MainForm
|
||||
checkbox5.Name = "checkbox5";
|
||||
checkbox5.Size = new System.Drawing.Size(51, 41);
|
||||
checkbox5.TabIndex = 10;
|
||||
checkbox5.Text = "1";
|
||||
checkbox5.Text = "5";
|
||||
//
|
||||
// checkbox4
|
||||
//
|
||||
@ -120,7 +118,7 @@ partial class MainForm
|
||||
checkbox4.Name = "checkbox4";
|
||||
checkbox4.Size = new System.Drawing.Size(51, 41);
|
||||
checkbox4.TabIndex = 9;
|
||||
checkbox4.Text = "1";
|
||||
checkbox4.Text = "4";
|
||||
//
|
||||
// checkbox3
|
||||
//
|
||||
@ -130,7 +128,7 @@ partial class MainForm
|
||||
checkbox3.Name = "checkbox3";
|
||||
checkbox3.Size = new System.Drawing.Size(51, 41);
|
||||
checkbox3.TabIndex = 8;
|
||||
checkbox3.Text = "1";
|
||||
checkbox3.Text = "3";
|
||||
//
|
||||
// checkbox2
|
||||
//
|
||||
@ -140,7 +138,7 @@ partial class MainForm
|
||||
checkbox2.Name = "checkbox2";
|
||||
checkbox2.Size = new System.Drawing.Size(51, 41);
|
||||
checkbox2.TabIndex = 7;
|
||||
checkbox2.Text = "1";
|
||||
checkbox2.Text = "2";
|
||||
//
|
||||
// checkbox1
|
||||
//
|
||||
@ -154,10 +152,8 @@ partial class MainForm
|
||||
//
|
||||
// groupBox2
|
||||
//
|
||||
groupBox2.Controls.Add(StartLabel);
|
||||
groupBox2.Controls.Add(input1);
|
||||
groupBox2.Controls.Add(SetStartButton);
|
||||
groupBox2.Controls.Add(CustomKeysLabel);
|
||||
groupBox2.Controls.Add(SetCustomButton);
|
||||
groupBox2.Controls.Add(inputNumber1);
|
||||
groupBox2.Controls.Add(label2);
|
||||
groupBox2.Controls.Add(select2);
|
||||
@ -165,55 +161,43 @@ partial class MainForm
|
||||
groupBox2.Font = new System.Drawing.Font("Microsoft YaHei UI", 12F, System.Drawing.FontStyle.Bold);
|
||||
groupBox2.Location = new System.Drawing.Point(12, 188);
|
||||
groupBox2.Name = "groupBox2";
|
||||
groupBox2.Size = new System.Drawing.Size(306, 286);
|
||||
groupBox2.Size = new System.Drawing.Size(306, 232);
|
||||
groupBox2.TabIndex = 13;
|
||||
groupBox2.TabStop = false;
|
||||
groupBox2.Text = "设置自定义启停,循环输入自定义按键";
|
||||
//
|
||||
// StartLabel
|
||||
// input1
|
||||
//
|
||||
StartLabel.Font = new System.Drawing.Font("Microsoft YaHei UI", 10F);
|
||||
StartLabel.Location = new System.Drawing.Point(14, 253);
|
||||
StartLabel.Name = "StartLabel";
|
||||
StartLabel.Size = new System.Drawing.Size(275, 21);
|
||||
StartLabel.TabIndex = 18;
|
||||
StartLabel.Text = "当前启停按键:无";
|
||||
input1.Font = new System.Drawing.Font("Microsoft YaHei UI", 10F);
|
||||
input1.Location = new System.Drawing.Point(14, 121);
|
||||
input1.MaxLength = 5;
|
||||
input1.Name = "input1";
|
||||
input1.PrefixText = "输入最多五个按键:";
|
||||
input1.Size = new System.Drawing.Size(266, 52);
|
||||
input1.SuffixText = "";
|
||||
input1.TabIndex = 17;
|
||||
//
|
||||
// SetStartButton
|
||||
//
|
||||
SetStartButton.Font = new System.Drawing.Font("Microsoft YaHei UI", 10F);
|
||||
SetStartButton.Location = new System.Drawing.Point(14, 202);
|
||||
SetStartButton.Location = new System.Drawing.Point(14, 179);
|
||||
SetStartButton.Name = "SetStartButton";
|
||||
SetStartButton.Size = new System.Drawing.Size(275, 45);
|
||||
SetStartButton.TabIndex = 17;
|
||||
SetStartButton.Text = "设置启停按键";
|
||||
//
|
||||
// CustomKeysLabel
|
||||
//
|
||||
CustomKeysLabel.Font = new System.Drawing.Font("Microsoft YaHei UI", 10F);
|
||||
CustomKeysLabel.Location = new System.Drawing.Point(14, 175);
|
||||
CustomKeysLabel.Name = "CustomKeysLabel";
|
||||
CustomKeysLabel.Size = new System.Drawing.Size(275, 21);
|
||||
CustomKeysLabel.TabIndex = 16;
|
||||
CustomKeysLabel.Text = "当前自动输入按键:无";
|
||||
//
|
||||
// SetCustomButton
|
||||
//
|
||||
SetCustomButton.Font = new System.Drawing.Font("Microsoft YaHei UI Light", 10F);
|
||||
SetCustomButton.Location = new System.Drawing.Point(14, 124);
|
||||
SetCustomButton.Name = "SetCustomButton";
|
||||
SetCustomButton.Size = new System.Drawing.Size(275, 45);
|
||||
SetCustomButton.TabIndex = 15;
|
||||
SetCustomButton.Text = "设置自动输入按键";
|
||||
SetStartButton.TabIndex = 19;
|
||||
SetStartButton.Text = "输入crtl+num3启停功能";
|
||||
//
|
||||
// inputNumber1
|
||||
//
|
||||
inputNumber1.Font = new System.Drawing.Font("Microsoft YaHei UI", 10F);
|
||||
inputNumber1.Location = new System.Drawing.Point(131, 71);
|
||||
inputNumber1.Location = new System.Drawing.Point(127, 71);
|
||||
inputNumber1.Maximum = new decimal(new int[] { 9999, 0, 0, 0 });
|
||||
inputNumber1.MaxLength = 5;
|
||||
inputNumber1.Minimum = new decimal(new int[] { 1000, 0, 0, 0 });
|
||||
inputNumber1.Name = "inputNumber1";
|
||||
inputNumber1.Size = new System.Drawing.Size(158, 44);
|
||||
inputNumber1.Size = new System.Drawing.Size(174, 44);
|
||||
inputNumber1.TabIndex = 14;
|
||||
inputNumber1.Text = "0";
|
||||
inputNumber1.Text = "1000";
|
||||
inputNumber1.Value = new decimal(new int[] { 1000, 0, 0, 0 });
|
||||
//
|
||||
// label2
|
||||
//
|
||||
@ -229,12 +213,12 @@ partial class MainForm
|
||||
//
|
||||
select2.Font = new System.Drawing.Font("Microsoft YaHei UI", 10F);
|
||||
select2.Items.AddRange(new object[] { "50 ms", "100 ms", "200 ms", "300 ms", "500 ms", "1000 ms", "2000 ms", "5000 ms" });
|
||||
select2.Location = new System.Drawing.Point(126, 27);
|
||||
select2.Location = new System.Drawing.Point(127, 27);
|
||||
select2.MaxCount = 12;
|
||||
select2.Name = "select2";
|
||||
select2.SelectedIndex = 0;
|
||||
select2.SelectedValue = "50 ms";
|
||||
select2.Size = new System.Drawing.Size(163, 44);
|
||||
select2.Size = new System.Drawing.Size(174, 44);
|
||||
select2.TabIndex = 12;
|
||||
select2.Text = "50 ms";
|
||||
//
|
||||
@ -251,10 +235,10 @@ partial class MainForm
|
||||
// ListenButton
|
||||
//
|
||||
ListenButton.Font = new System.Drawing.Font("Microsoft YaHei UI", 10F);
|
||||
ListenButton.Location = new System.Drawing.Point(12, 485);
|
||||
ListenButton.Location = new System.Drawing.Point(12, 426);
|
||||
ListenButton.Name = "ListenButton";
|
||||
ListenButton.Size = new System.Drawing.Size(306, 45);
|
||||
ListenButton.TabIndex = 19;
|
||||
ListenButton.TabIndex = 20;
|
||||
ListenButton.Text = "暂停所有功能(F2切换)";
|
||||
//
|
||||
// MainForm
|
||||
@ -263,7 +247,7 @@ partial class MainForm
|
||||
AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
AutoSize = true;
|
||||
AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
|
||||
ClientSize = new System.Drawing.Size(800, 542);
|
||||
ClientSize = new System.Drawing.Size(800, 480);
|
||||
Controls.Add(ListenButton);
|
||||
Controls.Add(groupBox2);
|
||||
Controls.Add(groupBox1);
|
||||
@ -279,14 +263,11 @@ partial class MainForm
|
||||
PerformLayout();
|
||||
}
|
||||
|
||||
private AntdUI.Input input1;
|
||||
|
||||
private AntdUI.Button ListenButton;
|
||||
|
||||
private AntdUI.Button SetStartButton;
|
||||
private AntdUI.Label StartLabel;
|
||||
|
||||
private AntdUI.Label CustomKeysLabel;
|
||||
|
||||
private AntdUI.Button SetCustomButton;
|
||||
|
||||
private AntdUI.InputNumber inputNumber1;
|
||||
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
using System.Diagnostics;
|
||||
using System.Reflection;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
using AntdUI;
|
||||
@ -14,15 +15,20 @@ public partial class MainForm : BaseForm
|
||||
private bool _customInputRunning = false;
|
||||
private List<Keys> _customKeys = new List<Keys>();
|
||||
private Keys[] _customStartHotkey;
|
||||
private int _customKeyDelay = 100;
|
||||
private int _customKeyDelay = 50;
|
||||
private int _loopDelay = 1000;
|
||||
private bool startCustomInput = false;
|
||||
|
||||
|
||||
public MainForm()
|
||||
{
|
||||
InitializeComponent();
|
||||
this.Load += OnLoad;
|
||||
|
||||
Assembly asm = Assembly.GetExecutingAssembly();
|
||||
using (Stream stream = asm.GetManifestResourceStream("POE_AutoFlask.icons.icon.ico"))
|
||||
{
|
||||
this.Icon = new Icon(stream);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -34,6 +40,7 @@ public partial class MainForm : BaseForm
|
||||
// 声明 API 和委托
|
||||
private const int WH_KEYBOARD_LL = 13;
|
||||
private const int WM_KEYDOWN = 0x0100;
|
||||
private const int WM_KEYUP = 0x0101;
|
||||
|
||||
private delegate IntPtr LowLevelKeyboardProc(int nCode, IntPtr wParam, IntPtr lParam);
|
||||
|
||||
@ -56,6 +63,9 @@ public partial class MainForm : BaseForm
|
||||
[DllImport("user32.dll")]
|
||||
static extern void keybd_event(byte bVk, byte bScan, int dwFlags, int dwExtraInfo);
|
||||
|
||||
[DllImport("user32.dll")]
|
||||
static extern short GetAsyncKeyState(Keys vKey);
|
||||
|
||||
private void SetHook()
|
||||
{
|
||||
Console.WriteLine("按下 ` 键将模拟输入 12345。");
|
||||
@ -69,10 +79,10 @@ public partial class MainForm : BaseForm
|
||||
|
||||
private static IntPtr HookCallback(int nCode, IntPtr wParam, IntPtr lParam)
|
||||
{
|
||||
int vkCode = Marshal.ReadInt32(lParam);
|
||||
var ctrlPressed = false;
|
||||
if (nCode >= 0 && wParam == (IntPtr)WM_KEYDOWN)
|
||||
{
|
||||
int vkCode = Marshal.ReadInt32(lParam);
|
||||
|
||||
if (vkCode == (int)Keys.F2)
|
||||
{
|
||||
_isListening = !_isListening;
|
||||
@ -84,8 +94,10 @@ public partial class MainForm : BaseForm
|
||||
{
|
||||
// form.Text = _isListening ? "监听已开启" : "监听已暂停";
|
||||
form.ListenStatus.Text = _isListening ? "状态:监听中(F2切换)" : "状态:已停止(F2切换)";
|
||||
form.ListenButton.Text = _isListening ? "暂停所有功能(F2切换)" : "启用所有功能(F2切换)";
|
||||
}));
|
||||
}
|
||||
|
||||
return (IntPtr)1;
|
||||
}
|
||||
|
||||
@ -94,11 +106,22 @@ public partial class MainForm : BaseForm
|
||||
var form = Application.OpenForms[0] as MainForm;
|
||||
if (form != null)
|
||||
{
|
||||
form.Invoke(new Action(() =>
|
||||
{
|
||||
form.TriggerSimulate();
|
||||
}));
|
||||
form.Invoke(new Action(() => { form.TriggerSimulate(); }));
|
||||
}
|
||||
|
||||
return (IntPtr)1;
|
||||
}
|
||||
|
||||
|
||||
if (_isListening && vkCode == (int)Keys.NumPad3 && IsKeyDown(Keys.LControlKey)) // 按下 `
|
||||
{
|
||||
Console.WriteLine("control press");
|
||||
var form = Application.OpenForms[0] as MainForm;
|
||||
if (form != null)
|
||||
{
|
||||
form.Invoke(new Action(() => { form.TriggerSimulateCustom(); }));
|
||||
}
|
||||
|
||||
return (IntPtr)1;
|
||||
}
|
||||
}
|
||||
@ -106,6 +129,12 @@ public partial class MainForm : BaseForm
|
||||
return CallNextHookEx(_hookID, nCode, wParam, lParam);
|
||||
}
|
||||
|
||||
// 使用 GetAsyncKeyState 判断某个按键当前是否处于按下状态
|
||||
static bool IsKeyDown(Keys key)
|
||||
{
|
||||
return (GetAsyncKeyState(key) & 0x8000) != 0;
|
||||
}
|
||||
|
||||
public void TriggerSimulate()
|
||||
{
|
||||
_cts?.Cancel(); // 取消上一次
|
||||
@ -113,10 +142,9 @@ public partial class MainForm : BaseForm
|
||||
SimulateKeyByCheckbox(_cts.Token);
|
||||
}
|
||||
|
||||
|
||||
private async void SimulateKeyByCheckbox(CancellationToken token)
|
||||
{
|
||||
int delay = GetDelayFromComboBox();
|
||||
int delay = GetDelayFromComboBox(select1);
|
||||
|
||||
async Task TrySendKey(bool condition, Keys key)
|
||||
{
|
||||
@ -142,15 +170,141 @@ public partial class MainForm : BaseForm
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private int GetDelayFromComboBox()
|
||||
public void TriggerSimulateCustom()
|
||||
{
|
||||
string selected = select1.SelectedValue?.ToString() ?? "50 ms";
|
||||
startCustomInput = !startCustomInput;
|
||||
if (startCustomInput && input1.Text.Length >= 1)
|
||||
{
|
||||
_customInputCts = new CancellationTokenSource();
|
||||
SimulateKeyByCheckboxCustom(_customInputCts.Token);
|
||||
groupBox2.Enabled = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
_customInputCts?.Cancel(); // 取消上一次
|
||||
groupBox2.Enabled = true;
|
||||
}
|
||||
}
|
||||
|
||||
private async void SimulateKeyByCheckboxCustom(CancellationToken token)
|
||||
{
|
||||
int delay = GetDelayFromComboBox(select2);
|
||||
|
||||
async Task TrySendKey(bool condition, Keys key)
|
||||
{
|
||||
if (condition)
|
||||
{
|
||||
if (token.IsCancellationRequested) return;
|
||||
SimulateKey(key);
|
||||
await Task.Delay(delay, token);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
RemoveDuplicateChars(input1);
|
||||
_customKeys = StringToKeys(input1.Text);
|
||||
Console.WriteLine($"keys:{_customKeys}");
|
||||
try
|
||||
{
|
||||
while (_isListening)
|
||||
{
|
||||
for (int i = 0; i < _customKeys.Count; i++)
|
||||
{
|
||||
await TrySendKey(checkbox2.Checked, _customKeys[i]);
|
||||
Console.WriteLine($"key press:{_customKeys[i]}");
|
||||
}
|
||||
|
||||
await Task.Delay((int)inputNumber1.Value);
|
||||
}
|
||||
}
|
||||
catch (TaskCanceledException)
|
||||
{
|
||||
// 被打断,正常退出
|
||||
}
|
||||
}
|
||||
|
||||
static List<Keys> StringToKeys(string str)
|
||||
{
|
||||
var keyList = new List<Keys>();
|
||||
|
||||
foreach (char ch in str)
|
||||
{
|
||||
Keys key;
|
||||
|
||||
if (char.IsLetter(ch))
|
||||
{
|
||||
// 字母,转为大写
|
||||
key = (Keys)Enum.Parse(typeof(Keys), char.ToUpper(ch).ToString());
|
||||
}
|
||||
else if (char.IsDigit(ch))
|
||||
{
|
||||
// 数字直接对应
|
||||
key = (Keys)Enum.Parse(typeof(Keys), "D" + ch);
|
||||
}
|
||||
else
|
||||
{
|
||||
// 处理常用符号
|
||||
switch (ch)
|
||||
{
|
||||
case ' ': key = Keys.Space; break;
|
||||
case '!': key = Keys.D1; break;
|
||||
case '@': key = Keys.D2; break;
|
||||
case '#': key = Keys.D3; break;
|
||||
case '$': key = Keys.D4; break;
|
||||
case '%': key = Keys.D5; break;
|
||||
case '^': key = Keys.D6; break;
|
||||
case '&': key = Keys.D7; break;
|
||||
case '*': key = Keys.D8; break;
|
||||
case '(': key = Keys.D9; break;
|
||||
case ')': key = Keys.D0; break;
|
||||
case '-': key = Keys.OemMinus; break;
|
||||
case '=': key = Keys.Oemplus; break;
|
||||
case '[': key = Keys.OemOpenBrackets; break;
|
||||
case ']': key = Keys.OemCloseBrackets; break;
|
||||
case '\\': key = Keys.OemBackslash; break;
|
||||
case ';': key = Keys.OemSemicolon; break;
|
||||
case '\'': key = Keys.OemQuotes; break;
|
||||
case ',': key = Keys.Oemcomma; break;
|
||||
case '.': key = Keys.OemPeriod; break;
|
||||
case '/': key = Keys.OemQuestion; break;
|
||||
case '`': key = Keys.Oemtilde; break;
|
||||
default:
|
||||
Console.WriteLine($"暂不支持字符: {ch}");
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
keyList.Add(key);
|
||||
}
|
||||
|
||||
return keyList;
|
||||
}
|
||||
|
||||
static void RemoveDuplicateChars(Input input)
|
||||
{
|
||||
HashSet<char> seen = new HashSet<char>();
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
foreach (char c in input.Text)
|
||||
{
|
||||
if (seen.Add(c)) // Add 返回 true 表示第一次出现
|
||||
{
|
||||
sb.Append(c);
|
||||
}
|
||||
}
|
||||
|
||||
input.Text = sb.ToString();
|
||||
}
|
||||
|
||||
private int GetDelayFromComboBox(Select select)
|
||||
{
|
||||
string selected = select.SelectedValue?.ToString() ?? "50 ms";
|
||||
if (selected.EndsWith("ms"))
|
||||
{
|
||||
if (int.TryParse(selected.Replace("ms", "").Trim(), out int ms))
|
||||
return ms;
|
||||
}
|
||||
|
||||
return 50; // 默认值
|
||||
}
|
||||
|
||||
@ -160,5 +314,4 @@ public partial class MainForm : BaseForm
|
||||
keybd_event(vk, 0, 0, 0); // key down
|
||||
keybd_event(vk, 0, 2, 0); // key up
|
||||
}
|
||||
|
||||
}
|
||||
@ -7,14 +7,16 @@
|
||||
<Nullable>enable</Nullable>
|
||||
<UseWindowsForms>true</UseWindowsForms>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<ApplicationIcon>icons\icon.ico</ApplicationIcon>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="AntdUI" Version="2.0.6" />
|
||||
<PackageReference Include="AntdUI" Version="2.0.6"/>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Folder Include="icons\" />
|
||||
<Folder Include="icons\"/>
|
||||
<EmbeddedResource Include="icons\icon.ico" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 34 KiB |
@ -13,7 +13,7 @@ using System.Reflection;
|
||||
[assembly: System.Reflection.AssemblyCompanyAttribute("POE-AutoFlask")]
|
||||
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
|
||||
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
|
||||
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+cd6acdea610785546d242d243d1cf85b1ceca490")]
|
||||
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+85dd9335188326d46bdec3da466c474e9439f510")]
|
||||
[assembly: System.Reflection.AssemblyProductAttribute("POE-AutoFlask")]
|
||||
[assembly: System.Reflection.AssemblyTitleAttribute("POE-AutoFlask")]
|
||||
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
|
||||
|
||||
@ -1 +1 @@
|
||||
9ca5b903f50f9caee22889ea3fac9ff2ff5ca0ede93c2a0d53e2ec649e56fac0
|
||||
48cbbdbf79010bbd34c75a3c68995ff20d0adc96cd356c6536594db6b4922552
|
||||
|
||||
@ -1,4 +1,8 @@
|
||||
is_global = true
|
||||
build_property.EnableAotAnalyzer =
|
||||
build_property.EnableSingleFileAnalyzer =
|
||||
build_property.EnableTrimAnalyzer =
|
||||
build_property.IncludeAllContentForSelfExtract =
|
||||
build_property.ApplicationManifest =
|
||||
build_property.StartupObject =
|
||||
build_property.ApplicationDefaultFont =
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -46,6 +46,12 @@
|
||||
"AntdUI": {
|
||||
"target": "Package",
|
||||
"version": "[2.0.6, )"
|
||||
},
|
||||
"Microsoft.NET.ILLink.Tasks": {
|
||||
"suppressParent": "All",
|
||||
"target": "Package",
|
||||
"version": "[8.0.4, )",
|
||||
"autoReferenced": true
|
||||
}
|
||||
},
|
||||
"imports": [
|
||||
@ -69,6 +75,11 @@
|
||||
},
|
||||
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\8.0.204/PortableRuntimeIdentifierGraph.json"
|
||||
}
|
||||
},
|
||||
"runtimes": {
|
||||
"win-x64": {
|
||||
"#import": []
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -7,9 +7,15 @@
|
||||
<NuGetPackageRoot Condition=" '$(NuGetPackageRoot)' == '' ">$(UserProfile)\.nuget\packages\</NuGetPackageRoot>
|
||||
<NuGetPackageFolders Condition=" '$(NuGetPackageFolders)' == '' ">C:\Users\Administrator\.nuget\packages\</NuGetPackageFolders>
|
||||
<NuGetProjectStyle Condition=" '$(NuGetProjectStyle)' == '' ">PackageReference</NuGetProjectStyle>
|
||||
<NuGetToolVersion Condition=" '$(NuGetToolVersion)' == '' ">6.14.0</NuGetToolVersion>
|
||||
<NuGetToolVersion Condition=" '$(NuGetToolVersion)' == '' ">6.9.1</NuGetToolVersion>
|
||||
</PropertyGroup>
|
||||
<ItemGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
|
||||
<SourceRoot Include="C:\Users\Administrator\.nuget\packages\" />
|
||||
</ItemGroup>
|
||||
<ImportGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
|
||||
<Import Project="$(NuGetPackageRoot)microsoft.net.illink.tasks\8.0.4\build\Microsoft.NET.ILLink.Tasks.props" Condition="Exists('$(NuGetPackageRoot)microsoft.net.illink.tasks\8.0.4\build\Microsoft.NET.ILLink.Tasks.props')" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
|
||||
<PkgMicrosoft_NET_ILLink_Tasks Condition=" '$(PkgMicrosoft_NET_ILLink_Tasks)' == '' ">C:\Users\Administrator\.nuget\packages\microsoft.net.illink.tasks\8.0.4</PkgMicrosoft_NET_ILLink_Tasks>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
@ -17,6 +17,36 @@
|
||||
"frameworkReferences": [
|
||||
"Microsoft.WindowsDesktop.App.WindowsForms"
|
||||
]
|
||||
},
|
||||
"Microsoft.NET.ILLink.Tasks/8.0.4": {
|
||||
"type": "package",
|
||||
"build": {
|
||||
"build/Microsoft.NET.ILLink.Tasks.props": {}
|
||||
}
|
||||
}
|
||||
},
|
||||
"net8.0-windows7.0/win-x64": {
|
||||
"AntdUI/2.0.6": {
|
||||
"type": "package",
|
||||
"compile": {
|
||||
"lib/net8.0-windows7.0/AntdUI.dll": {
|
||||
"related": ".xml"
|
||||
}
|
||||
},
|
||||
"runtime": {
|
||||
"lib/net8.0-windows7.0/AntdUI.dll": {
|
||||
"related": ".xml"
|
||||
}
|
||||
},
|
||||
"frameworkReferences": [
|
||||
"Microsoft.WindowsDesktop.App.WindowsForms"
|
||||
]
|
||||
},
|
||||
"Microsoft.NET.ILLink.Tasks/8.0.4": {
|
||||
"type": "package",
|
||||
"build": {
|
||||
"build/Microsoft.NET.ILLink.Tasks.props": {}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
@ -45,11 +75,63 @@
|
||||
"lib/net9.0-windows7.0/AntdUI.xml",
|
||||
"logo.png"
|
||||
]
|
||||
},
|
||||
"Microsoft.NET.ILLink.Tasks/8.0.4": {
|
||||
"sha512": "PZb5nfQ+U19nhnmnR9T1jw+LTmozhuG2eeuzuW5A7DqxD/UXW2ucjmNJqnqOuh8rdPzM3MQXoF8AfFCedJdCUw==",
|
||||
"type": "package",
|
||||
"path": "microsoft.net.illink.tasks/8.0.4",
|
||||
"hasTools": true,
|
||||
"files": [
|
||||
".nupkg.metadata",
|
||||
".signature.p7s",
|
||||
"Icon.png",
|
||||
"LICENSE.TXT",
|
||||
"Sdk/Sdk.props",
|
||||
"THIRD-PARTY-NOTICES.TXT",
|
||||
"analyzers/dotnet/cs/ILLink.CodeFixProvider.dll",
|
||||
"analyzers/dotnet/cs/ILLink.RoslynAnalyzer.dll",
|
||||
"build/Microsoft.NET.ILLink.Analyzers.props",
|
||||
"build/Microsoft.NET.ILLink.Tasks.props",
|
||||
"build/Microsoft.NET.ILLink.targets",
|
||||
"microsoft.net.illink.tasks.8.0.4.nupkg.sha512",
|
||||
"microsoft.net.illink.tasks.nuspec",
|
||||
"tools/net472/ILLink.Tasks.dll",
|
||||
"tools/net472/ILLink.Tasks.dll.config",
|
||||
"tools/net472/Mono.Cecil.Mdb.dll",
|
||||
"tools/net472/Mono.Cecil.Pdb.dll",
|
||||
"tools/net472/Mono.Cecil.Rocks.dll",
|
||||
"tools/net472/Mono.Cecil.dll",
|
||||
"tools/net472/Sdk/Sdk.props",
|
||||
"tools/net472/System.Buffers.dll",
|
||||
"tools/net472/System.Collections.Immutable.dll",
|
||||
"tools/net472/System.Memory.dll",
|
||||
"tools/net472/System.Numerics.Vectors.dll",
|
||||
"tools/net472/System.Reflection.Metadata.dll",
|
||||
"tools/net472/System.Runtime.CompilerServices.Unsafe.dll",
|
||||
"tools/net472/build/Microsoft.NET.ILLink.Analyzers.props",
|
||||
"tools/net472/build/Microsoft.NET.ILLink.Tasks.props",
|
||||
"tools/net472/build/Microsoft.NET.ILLink.targets",
|
||||
"tools/net8.0/ILLink.Tasks.deps.json",
|
||||
"tools/net8.0/ILLink.Tasks.dll",
|
||||
"tools/net8.0/Mono.Cecil.Mdb.dll",
|
||||
"tools/net8.0/Mono.Cecil.Pdb.dll",
|
||||
"tools/net8.0/Mono.Cecil.Rocks.dll",
|
||||
"tools/net8.0/Mono.Cecil.dll",
|
||||
"tools/net8.0/Sdk/Sdk.props",
|
||||
"tools/net8.0/build/Microsoft.NET.ILLink.Analyzers.props",
|
||||
"tools/net8.0/build/Microsoft.NET.ILLink.Tasks.props",
|
||||
"tools/net8.0/build/Microsoft.NET.ILLink.targets",
|
||||
"tools/net8.0/illink.deps.json",
|
||||
"tools/net8.0/illink.dll",
|
||||
"tools/net8.0/illink.runtimeconfig.json",
|
||||
"useSharedDesignerContext.txt"
|
||||
]
|
||||
}
|
||||
},
|
||||
"projectFileDependencyGroups": {
|
||||
"net8.0-windows7.0": [
|
||||
"AntdUI >= 2.0.6"
|
||||
"AntdUI >= 2.0.6",
|
||||
"Microsoft.NET.ILLink.Tasks >= 8.0.4"
|
||||
]
|
||||
},
|
||||
"packageFolders": {
|
||||
@ -97,6 +179,12 @@
|
||||
"AntdUI": {
|
||||
"target": "Package",
|
||||
"version": "[2.0.6, )"
|
||||
},
|
||||
"Microsoft.NET.ILLink.Tasks": {
|
||||
"suppressParent": "All",
|
||||
"target": "Package",
|
||||
"version": "[8.0.4, )",
|
||||
"autoReferenced": true
|
||||
}
|
||||
},
|
||||
"imports": [
|
||||
@ -120,6 +208,11 @@
|
||||
},
|
||||
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\8.0.204/PortableRuntimeIdentifierGraph.json"
|
||||
}
|
||||
},
|
||||
"runtimes": {
|
||||
"win-x64": {
|
||||
"#import": []
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,10 +1,11 @@
|
||||
{
|
||||
"version": 2,
|
||||
"dgSpecHash": "NeGOjeqNPKM=",
|
||||
"dgSpecHash": "mHFha3lj8kP6xsEOszLTjDNwi/gsEK/5gzjW3GrVS6q+26XJkMuk2qSwyV51LdCEmJuR5EYURVSQK0teZV5kqQ==",
|
||||
"success": true,
|
||||
"projectFilePath": "H:\\Projects\\python\\POE-AutoFlask\\POE-AutoFlask\\POE-AutoFlask\\POE-AutoFlask.csproj",
|
||||
"expectedPackageFiles": [
|
||||
"C:\\Users\\Administrator\\.nuget\\packages\\antdui\\2.0.6\\antdui.2.0.6.nupkg.sha512"
|
||||
"C:\\Users\\Administrator\\.nuget\\packages\\antdui\\2.0.6\\antdui.2.0.6.nupkg.sha512",
|
||||
"C:\\Users\\Administrator\\.nuget\\packages\\microsoft.net.illink.tasks\\8.0.4\\microsoft.net.illink.tasks.8.0.4.nupkg.sha512"
|
||||
],
|
||||
"logs": []
|
||||
}
|
||||
@ -1 +1 @@
|
||||
17509268579972585
|
||||
17509467341574008
|
||||
@ -1 +1 @@
|
||||
17509268590150211
|
||||
17509462198510504
|
||||
Reference in New Issue
Block a user