diff --git a/.gitignore b/.gitignore index 77e2a97..ac93f61 100644 --- a/.gitignore +++ b/.gitignore @@ -3,16 +3,16 @@ /KEBHtool/bin/ /KEBHtool/lib/ /KEBHtool/obj/ -/KEBHtool.Wpf.Test/bin/ -/KEBHtool.Wpf.Test/obj/ +/KEBHtool.Wpf.Demo/bin/ +/KEBHtool.Wpf.Demo/obj/ /publish/ *.nupkg /publish/KEBHtool /publish /KBEHtool/obj /KBEHtool/lib -/KBEHtool.Wpf.Test/obj -/KBEHtool.Wpf.Test/bin -/KBEHtool.Wpf.Test/bin -/KBEHtool.Wpf.Test/bin +/KBEHtool.Wpf.Demo/obj +/KBEHtool.Wpf.Demo/bin +/KBEHtool.Wpf.Demo/bin +/KBEHtool.Wpf.Demo/bin /KBEHtool/bin diff --git a/KBEHtool.Wpf.Test/App.xaml b/KBEHtool.Wpf.Demo/App.xaml similarity index 100% rename from KBEHtool.Wpf.Test/App.xaml rename to KBEHtool.Wpf.Demo/App.xaml diff --git a/KBEHtool.Wpf.Test/App.xaml.cs b/KBEHtool.Wpf.Demo/App.xaml.cs similarity index 100% rename from KBEHtool.Wpf.Test/App.xaml.cs rename to KBEHtool.Wpf.Demo/App.xaml.cs diff --git a/KBEHtool.Wpf.Test/AssemblyInfo.cs b/KBEHtool.Wpf.Demo/AssemblyInfo.cs similarity index 100% rename from KBEHtool.Wpf.Test/AssemblyInfo.cs rename to KBEHtool.Wpf.Demo/AssemblyInfo.cs diff --git a/KBEHtool.Wpf.Test/KBEHtool.Wpf.Test.csproj b/KBEHtool.Wpf.Demo/KBEHtool.Wpf.Demo.csproj similarity index 77% rename from KBEHtool.Wpf.Test/KBEHtool.Wpf.Test.csproj rename to KBEHtool.Wpf.Demo/KBEHtool.Wpf.Demo.csproj index 50956b7..b067dda 100644 --- a/KBEHtool.Wpf.Test/KBEHtool.Wpf.Test.csproj +++ b/KBEHtool.Wpf.Demo/KBEHtool.Wpf.Demo.csproj @@ -2,11 +2,12 @@ WinExe - net8.0-windows + net9.0-windows enable enable true true + KBEHtool.Wpf.Test diff --git a/KBEHtool.Wpf.Test/MainWindow.xaml b/KBEHtool.Wpf.Demo/MainWindow.xaml similarity index 100% rename from KBEHtool.Wpf.Test/MainWindow.xaml rename to KBEHtool.Wpf.Demo/MainWindow.xaml diff --git a/KBEHtool.Wpf.Test/MainWindow.xaml.cs b/KBEHtool.Wpf.Demo/MainWindow.xaml.cs similarity index 92% rename from KBEHtool.Wpf.Test/MainWindow.xaml.cs rename to KBEHtool.Wpf.Demo/MainWindow.xaml.cs index 5d665b9..79ba5ae 100644 --- a/KBEHtool.Wpf.Test/MainWindow.xaml.cs +++ b/KBEHtool.Wpf.Demo/MainWindow.xaml.cs @@ -12,7 +12,7 @@ public partial class MainWindow : Window public MainWindow() { IntPtr handle = new WindowInteropHelper(this).Handle; - KBEH.StartKBEH(); + KBEH.Start(); InitializeComponent(); KeyAction.AddKeyDownListener((keycode) => MyKeyDown(keycode)); KeyAction.AddKeyUpListener((keycode) => MyKeyUp(keycode)); @@ -51,13 +51,13 @@ private void DispatcherTimer_Tick(object sender, EventArgs e) private void Window_Closed(object sender, EventArgs e) { - KBEH.StopKBEH(); + KBEH.Stop(); } private void PressVBK(object sender, RoutedEventArgs e) { //KeyAction.PressKey(KeyCode.A,1000); - KeyAction.PressKey(new [] { KeyCode.LeftControl , KeyCode.Space},1000); + KeyAction.PressKey(new [] { KeyCode.LeftAlt , KeyCode.A},1000);//打开微信截图 } } } \ No newline at end of file diff --git a/KBEHtool.sln b/KBEHtool.sln index 55820d1..2c73dd8 100644 --- a/KBEHtool.sln +++ b/KBEHtool.sln @@ -2,7 +2,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "KBEHtool", "KBEHtool\KBEHtool.csproj", "{6D7F396C-5E30-4961-A8D0-2B428CFFEC93}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "KBEHtool.Wpf.Test", "KBEHtool.Wpf.Test\KBEHtool.Wpf.Test.csproj", "{D19930F6-B3AC-40C2-92AA-B253677F87CF}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "KBEHtool.Wpf.Demo", "KBEHtool.Wpf.Demo\KBEHtool.Wpf.Demo.csproj", "{D19930F6-B3AC-40C2-92AA-B253677F87CF}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution diff --git a/KBEHtool/KBEH.cs b/KBEHtool/KBEH.cs index 07fa051..e0278f1 100644 --- a/KBEHtool/KBEH.cs +++ b/KBEHtool/KBEH.cs @@ -9,7 +9,7 @@ public class KBEH private static bool isRunning = false; private static KeyboardHook keyboardHook= null; - public static bool StartKBEH() + public static bool Start() { if (!isRunning) { @@ -20,15 +20,13 @@ public static bool StartKBEH() } catch (Exception e) { - Console.WriteLine(e); return false; } } - Console.WriteLine("KBEH service already running"); return true; } - public static bool StopKBEH() + public static bool Stop() { if (isRunning) { @@ -41,11 +39,9 @@ public static bool StopKBEH() } catch (Exception e) { - Console.WriteLine(e); return false; } } - Console.WriteLine("KBEH service has stopped running"); return true; } } \ No newline at end of file diff --git a/KBEHtool/KBEHtool.csproj b/KBEHtool/KBEHtool.csproj index d9f693e..5249c40 100644 --- a/KBEHtool/KBEHtool.csproj +++ b/KBEHtool/KBEHtool.csproj @@ -1,7 +1,7 @@  - net8.0-windows;net7.0-windows;net6.0-windows + net9.0-windows;net8.0-windows;net7.0-windows;net6.0-windows enable enable true