├── .gitignore ├── LICENSE ├── README.md ├── README.zh-CN.md ├── documents └── images │ ├── keyboard-mouse-hook-logo.png │ └── screen-shots.png └── src ├── .gitattributes ├── .gitignore ├── Examples ├── ConsoleExample │ ├── App.config │ ├── ConsoleExample.csproj │ ├── LogKeys.cs │ ├── Program.cs │ ├── Properties │ │ └── AssemblyInfo.cs │ └── packages.config ├── WinformExample │ ├── App.config │ ├── FormMain.Designer.cs │ ├── FormMain.cs │ ├── FormMain.resx │ ├── Program.cs │ ├── Properties │ │ ├── AssemblyInfo.cs │ │ ├── Resources.Designer.cs │ │ ├── Resources.resx │ │ ├── Settings.Designer.cs │ │ └── Settings.settings │ ├── WinformExample.csproj │ └── packages.config └── WpfExample │ ├── App.config │ ├── App.xaml │ ├── App.xaml.cs │ ├── MainWindow.xaml │ ├── MainWindow.xaml.cs │ ├── Properties │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ ├── Resources.resx │ ├── Settings.Designer.cs │ └── Settings.settings │ ├── WpfExample.csproj │ └── packages.config ├── KeyMouseHook.sln └── KeyMouseHook ├── Entity └── MacroEvent.cs ├── Hotkey.cs ├── KeyMouseFactory.cs ├── KeyMouseHook.csproj ├── KeyMouseHook.nuspec ├── KeyboardWatcher.cs ├── MouseWatcher.cs ├── Properties └── AssemblyInfo.cs ├── Simulators ├── GlobalKeySimulator.cs ├── GlobalMouseSimulator.cs └── KeyMouseSimulator.cs ├── Utils └── PointConvertor.cs ├── WindowsInput ├── IInputDeviceStateAdaptor.cs ├── IInputMessageDispatcher.cs ├── IInputSimulator.cs ├── IKeyboardSimulator.cs ├── IMouseSimulator.cs ├── InputBuilder.cs ├── InputSimulator.cs ├── KeyboardSimulator.cs ├── MouseButton.cs ├── MouseSimulator.cs ├── Native │ ├── Entity │ │ ├── CopyDataStruct.cs │ │ └── NativeCalls.cs │ ├── HARDWAREINPUT.cs │ ├── INPUT.cs │ ├── InputType.cs │ ├── KEYBDINPUT.cs │ ├── KeyboardFlag.cs │ ├── MOUSEINPUT.cs │ ├── MOUSEKEYBDHARDWAREINPUT.cs │ ├── MouseFlag.cs │ ├── NativeMethods.cs │ ├── VirtualKeyCode.cs │ ├── WinApi.cs │ └── XButton.cs ├── WindowsInputDeviceStateAdaptor.cs └── WindowsInputMessageDispatcher.cs ├── build.bat └── packages.config /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | 4 | # User-specific files 5 | *.suo 6 | *.user 7 | *.userosscache 8 | *.sln.docstates 9 | 10 | # User-specific files (MonoDevelop/Xamarin Studio) 11 | *.userprefs 12 | 13 | # Build results 14 | [Dd]ebug/ 15 | [Dd]ebugPublic/ 16 | [Rr]elease/ 17 | [Rr]eleases/ 18 | x64/ 19 | x86/ 20 | build/ 21 | bld/ 22 | [Bb]in/ 23 | [Oo]bj/ 24 | 25 | # Visual Studo 2015 cache/options directory 26 | .vs/ 27 | 28 | # MSTest test Results 29 | [Tt]est[Rr]esult*/ 30 | [Bb]uild[Ll]og.* 31 | 32 | # NUNIT 33 | *.VisualState.xml 34 | TestResult.xml 35 | 36 | # Build Results of an ATL Project 37 | [Dd]ebugPS/ 38 | [Rr]eleasePS/ 39 | dlldata.c 40 | 41 | *_i.c 42 | *_p.c 43 | *_i.h 44 | *.ilk 45 | *.meta 46 | *.obj 47 | *.pch 48 | *.pdb 49 | *.pgc 50 | *.pgd 51 | *.rsp 52 | *.sbr 53 | *.tlb 54 | *.tli 55 | *.tlh 56 | *.tmp 57 | *.tmp_proj 58 | *.log 59 | *.vspscc 60 | *.vssscc 61 | .builds 62 | *.pidb 63 | *.svclog 64 | *.scc 65 | 66 | # Chutzpah Test files 67 | _Chutzpah* 68 | 69 | # Visual C++ cache files 70 | ipch/ 71 | *.aps 72 | *.ncb 73 | *.opensdf 74 | *.sdf 75 | *.cachefile 76 | 77 | # Visual Studio profiler 78 | *.psess 79 | *.vsp 80 | *.vspx 81 | 82 | # TFS 2012 Local Workspace 83 | $tf/ 84 | 85 | # Guidance Automation Toolkit 86 | *.gpState 87 | 88 | # ReSharper is a .NET coding add-in 89 | _ReSharper*/ 90 | *.[Rr]e[Ss]harper 91 | *.DotSettings.user 92 | 93 | # JustCode is a .NET coding addin-in 94 | .JustCode 95 | 96 | # TeamCity is a build add-in 97 | _TeamCity* 98 | 99 | # DotCover is a Code Coverage Tool 100 | *.dotCover 101 | 102 | # NCrunch 103 | _NCrunch_* 104 | .*crunch*.local.xml 105 | 106 | # MightyMoose 107 | *.mm.* 108 | AutoTest.Net/ 109 | 110 | # Web workbench (sass) 111 | .sass-cache/ 112 | 113 | # Installshield output folder 114 | [Ee]xpress/ 115 | 116 | # DocProject is a documentation generator add-in 117 | DocProject/buildhelp/ 118 | DocProject/Help/*.HxT 119 | DocProject/Help/*.HxC 120 | DocProject/Help/*.hhc 121 | DocProject/Help/*.hhk 122 | DocProject/Help/*.hhp 123 | DocProject/Help/Html2 124 | DocProject/Help/html 125 | 126 | # Click-Once directory 127 | publish/ 128 | 129 | # Publish Web Output 130 | *.[Pp]ublish.xml 131 | *.azurePubxml 132 | # TODO: Comment the next line if you want to checkin your web deploy settings 133 | # but database connection strings (with potential passwords) will be unencrypted 134 | *.pubxml 135 | *.publishproj 136 | 137 | # NuGet Packages 138 | *.nupkg 139 | **/.nuget/* 140 | */.nuget/* 141 | /src/.nuget/* 142 | # The packages folder can be ignored because of Package Restore 143 | **/packages/* 144 | /src/packages/* 145 | # except build/, which is used as an MSBuild target. 146 | !**/packages/build/ 147 | # Uncomment if necessary however generally it will be regenerated when needed 148 | #!**/packages/repositories.config 149 | 150 | # Windows Azure Build Output 151 | csx/ 152 | *.build.csdef 153 | 154 | # Windows Store app package directory 155 | AppPackages/ 156 | 157 | # Others 158 | *.[Cc]ache 159 | ClientBin/ 160 | [Ss]tyle[Cc]op.* 161 | ~$* 162 | *~ 163 | *.dbmdl 164 | *.dbproj.schemaview 165 | *.pfx 166 | *.publishsettings 167 | node_modules/ 168 | bower_components/ 169 | 170 | # RIA/Silverlight projects 171 | Generated_Code/ 172 | 173 | # Backup & report files from converting an old project file 174 | # to a newer Visual Studio version. Backup files are not needed, 175 | # because we have git ;-) 176 | _UpgradeReport_Files/ 177 | Backup*/ 178 | UpgradeLog*.XML 179 | UpgradeLog*.htm 180 | 181 | # SQL Server files 182 | *.mdf 183 | *.ldf 184 | 185 | # Business Intelligence projects 186 | *.rdl.data 187 | *.bim.layout 188 | *.bim_*.settings 189 | 190 | # Microsoft Fakes 191 | FakesAssemblies/ 192 | 193 | # Node.js Tools for Visual Studio 194 | .ntvs_analysis.dat 195 | 196 | # Visual Studio 6 build log 197 | *.plg 198 | 199 | # Visual Studio 6 workspace options file 200 | *.opt 201 | 202 | # Custom 203 | obj 204 | bin/ 205 | deploy 206 | deploy/* 207 | _ReSharper.* 208 | *.csproj.user 209 | *.resharper.user 210 | *.ReSharper.user 211 | *.resharper 212 | *.suo 213 | *.cache 214 | ~$* 215 | *.suo 216 | LPRun.5.1.ReSharper.user 217 | LPRun.5.1.ReSharper.user 218 | LPRun.suo 219 | LPRun.5.1.ReSharper.user 220 | */packages/* 221 | */packages 222 | /*.user 223 | */obj/* 224 | */bin/* 225 | .nuget/* 226 | */*.scc 227 | *.scc -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2018 Loamen 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software is furnished to do so, 10 | subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![nuget][nuget-badge]][nuget-url] 2 | [![stable](https://img.shields.io/badge/stable-stable-green.svg)](https://github.com/loamen/KeyMouseHook/) 3 | [![build](https://img.shields.io/shippable/5444c5ecb904a4b21567b0ff.svg)](https://travis-ci.org/loamen/KeyMouseHook) 4 | [![license](https://img.shields.io/badge/license-MIT-red.svg?style=flat)](https://raw.githubusercontent.com/loamen/KeyMouseHook/master/LICENSE) 5 | [![platforms](https://img.shields.io/badge/platform-Windows-yellow.svg?style=flat)]() 6 | [![download_count](https://img.shields.io/github/downloads/loamen/KeyMouseHook/total.svg?style=plastic)](https://github.com/loamen/KeyMouseHook/releases) 7 | [![release](https://img.shields.io/github/release/loamen/KeyMouseHook.svg?style=flat)](https://github.com/loamen/KeyMouseHook/releases) 8 | 9 | [nuget-badge]: https://img.shields.io/badge/nuget-v1.0.6-blue.svg 10 | [nuget-url]: https://www.nuget.org/packages/KeyMouseHook 11 | [source-url]: https://github.com/loamen/KeyMouseHook 12 | [mousekeyhook-url]: https://github.com/gmamaladze/globalmousekeyhook 13 | [inputsimulator-url]: https://github.com/michaelnoonan/inputsimulator 14 | [readme-url]: https://github.com/loamen/KeyMouseHook/blob/master/README.zh-CN.md 15 | 16 | ![Keyboard and Mouse Hooking and Simulator Library in c#(winform)](https://github.com/loamen/KeyMouseHook/raw/master/documents/images/keyboard-mouse-hook-logo.png) 17 | 18 | [中文介绍][readme-url] 19 | 20 | ## What it does? 21 | 22 | This is an extension to [globalmousekeyhook][mousekeyhook-url] and [InputSimulator][inputsimulator-url] library which allows you to tap keyboard and mouse, to detect and record their activity event when an application is inactive and runs in background.The Windows Input Simulator provides a simple .NET(C#) interface to simulate Keyboard or Mouse input using the Win32 SendInput method. 23 | 24 | ## Prerequisites 25 | 26 | * **Windows:** .Net Framework 4.0+ 27 | * **Branch master/dev:** .Net Framework 4.0 28 | * **Branch framework4.8:** .Net Framework 4.8 29 | 30 | ## Installation and sources 31 | 32 | 33 | > nuget install KeyMouseHook 34 | 35 | 36 | * [NuGet package][nuget-url] 37 | * [Source code][source-url] 38 | 39 | ## Usage 40 | 41 | ```csharp 42 | private readonly KeyMouseFactory eventHookFactory = new KeyMouseFactory(HookType.GlobalEvents); 43 | private readonly KeyboardWatcher keyboardWatcher; 44 | private readonly MouseWatcher mouseWatcher; 45 | private List _mouseKeyEvents; 46 | 47 | public FormMain() 48 | { 49 | InitializeComponent(); 50 | 51 | keyboardWatcher = eventHookFactory.GetKeyboardWatcher(); 52 | keyboardWatcher.OnKeyboardInput += (s, e) => 53 | { 54 | if (_mouseKeyEvents != null) 55 | _mouseKeyEvents.Add(e); 56 | }; 57 | 58 | mouseWatcher = eventHookFactory.GetMouseWatcher(); 59 | mouseWatcher.OnMouseInput += (s, e) => 60 | { 61 | if (_mouseKeyEvents != null) 62 | _mouseKeyEvents.Add(e); 63 | }; 64 | } 65 | 66 | private void StartWatch(IKeyboardMouseEvents events = null) 67 | { 68 | _macroEvents = new List(); 69 | keyboardWatcher.Start(events); 70 | mouseWatcher.Start(events); 71 | } 72 | 73 | private void StopWatch() 74 | { 75 | keyboardWatcher.Stop(); 76 | mouseWatcher.Stop(); 77 | } 78 | 79 | private void Playback() 80 | { 81 | var sim = new InputSimulator(); 82 | sim.PlayBack(_macroEvents); 83 | } 84 | ``` 85 | 86 | ```csharp 87 | keyboardWatcher = eventHookFactory.GetKeyboardWatcher().Disable(MacroEventType.KeyDown | MacroEventType.KeyUp).Enable(MacroEventType.KeyPress); 88 | mouseWatcher = eventHookFactory.GetMouseWatcher().Enable(MacroEventType.MouseDoubleClick | MacroEventType.MouseDragStarted).Disable(MacroEventType.MouseDragFinished | MacroEventType.MouseMove); 89 | var sim = new InputSimulator().Enable(MacroEventType.MouseDoubleClick | MacroEventType.KeyPress).Disable(MacroEventType.MouseMove | MacroEventType.KeyDown | MacroEventType.KeyUp); 90 | ``` 91 | 92 | (also have a look at the Demo app included with the source) 93 | 94 | ## Screen Shots 95 | 96 | ![Keyboard and Mouse Hooking and Simulator Library in c#(winform)](https://github.com/loamen/KeyMouseHook/raw/master/documents/images/screen-shots.png) 97 | 98 | ## Thanks 99 | 100 | * [globalmousekeyhook][mousekeyhook-url] (MIT License) 101 | * [InputSimulator][inputsimulator-url] (MIT License) 102 | 103 | ## Quick contributing guide 104 | 105 | - Fork and clone locally 106 | - Create a topic specific branch. Add some nice feature. 107 | - Send a Pull Request! 108 | 109 | ## License 110 | 111 | The MIT license see: [LICENSE](https://github.com/loamen/KeyMouseHook/blob/master/LICENSE) 112 | -------------------------------------------------------------------------------- /README.zh-CN.md: -------------------------------------------------------------------------------- 1 | [![nuget][nuget-badge]][nuget-url] 2 | [![stable](https://img.shields.io/badge/stable-stable-green.svg)](https://github.com/loamen/KeyMouseHook/) 3 | [![build](https://img.shields.io/shippable/5444c5ecb904a4b21567b0ff.svg)](https://travis-ci.org/loamen/KeyMouseHook) 4 | [![license](https://img.shields.io/badge/license-MIT-red.svg?style=flat)](https://raw.githubusercontent.com/loamen/KeyMouseHook/master/LICENSE) 5 | [![platforms](https://img.shields.io/badge/platform-Windows-yellow.svg?style=flat)]() 6 | [![download_count](https://img.shields.io/github/downloads/loamen/KeyMouseHook/total.svg?style=plastic)](https://github.com/loamen/KeyMouseHook/releases) 7 | [![release](https://img.shields.io/github/release/loamen/KeyMouseHook.svg?style=flat)](https://github.com/loamen/KeyMouseHook/releases) 8 | 龙门信息① 9 | 10 | [nuget-badge]: https://img.shields.io/badge/nuget-v1.0.6-blue.svg 11 | [nuget-url]: https://www.nuget.org/packages/KeyMouseHook 12 | [source-url]: https://github.com/loamen/KeyMouseHook 13 | [mousekeyhook-url]: https://github.com/gmamaladze/globalmousekeyhook 14 | [inputsimulator-url]: https://github.com/michaelnoonan/inputsimulator 15 | [readme-url]: https://github.com/loamen/KeyMouseHook/blob/master/README.md 16 | 17 | ![c#(winform)模拟键盘按键和鼠标点击操作类库](https://github.com/loamen/KeyMouseHook/raw/master/documents/images/keyboard-mouse-hook-logo.png) 18 | 19 | [English][readme-url] 20 | 21 | ## 简介 22 | 23 | 这是一个基于[globalmousekeyhook][mousekeyhook-url] 和 [InputSimulator][inputsimulator-url] 的类似于按键精灵的模拟键盘按键和鼠标点击操作的扩展类库。可以检测并记录键盘和鼠标的活动,你可以录制你的键鼠操作的记录并进行回放,可模拟键盘输入和鼠标点击操作。 24 | ## 环境 25 | 26 | * **Windows:** .Net Framework 4.0+ 27 | * **分支 master/dev:** .Net Framework 4.0 28 | * **分支 framework4.8:** .Net Framework 4.8 29 | 30 | ## 安装和源码 31 | 32 | > nuget install KeyMouseHook 33 | 34 | * [NuGet package][nuget-url] 35 | * [Source code][source-url] 36 | 37 | ## 使用 38 | 39 | ```csharp 40 | private readonly KeyMouseFactory eventHookFactory = new KeyMouseFactory(HookType.GlobalEvents); 41 | private readonly KeyboardWatcher keyboardWatcher; 42 | private readonly MouseWatcher mouseWatcher; 43 | private List _mouseKeyEvents; 44 | 45 | public FormMain() 46 | { 47 | InitializeComponent(); 48 | 49 | keyboardWatcher = eventHookFactory.GetKeyboardWatcher(); 50 | keyboardWatcher.OnKeyboardInput += (s, e) => 51 | { 52 | if (_mouseKeyEvents != null) 53 | _mouseKeyEvents.Add(e); 54 | }; 55 | 56 | mouseWatcher = eventHookFactory.GetMouseWatcher(); 57 | mouseWatcher.OnMouseInput += (s, e) => 58 | { 59 | if (_mouseKeyEvents != null) 60 | _mouseKeyEvents.Add(e); 61 | }; 62 | } 63 | 64 | private void StartWatch(IKeyboardMouseEvents events = null) 65 | { 66 | _macroEvents = new List(); 67 | keyboardWatcher.Start(events); 68 | mouseWatcher.Start(events); 69 | } 70 | 71 | private void StopWatch() 72 | { 73 | keyboardWatcher.Stop(); 74 | mouseWatcher.Stop(); 75 | } 76 | 77 | private void Playback() 78 | { 79 | var sim = new InputSimulator(); 80 | //var sim = new KeyMouseSimulator(); 81 | sim.PlayBack(_macroEvents); 82 | } 83 | ``` 84 | 85 | ```csharp 86 | keyboardWatcher = eventHookFactory.GetKeyboardWatcher().Disable(MacroEventType.KeyDown | MacroEventType.KeyUp).Enable(MacroEventType.KeyPress); 87 | mouseWatcher = eventHookFactory.GetMouseWatcher().Enable(MacroEventType.MouseDoubleClick | MacroEventType.MouseDragStarted).Disable(MacroEventType.MouseDragFinished | MacroEventType.MouseMove); 88 | var sim = new InputSimulator().Enable(MacroEventType.MouseDoubleClick | MacroEventType.KeyPress).Disable(MacroEventType.MouseMove | MacroEventType.KeyDown | MacroEventType.KeyUp); 89 | ``` 90 | 91 | 92 | (源码里包含更详细的示例) 93 | 94 | ## 界面 95 | 96 | ![c#(winform)模拟键盘按键和鼠标点击操作类库](https://github.com/loamen/KeyMouseHook/raw/master/documents/images/screen-shots.png) 97 | 98 | ## 鸣谢 99 | 100 | * [globalmousekeyhook][mousekeyhook-url] (MIT License) 101 | * [InputSimulator][inputsimulator-url] (MIT License) 102 | 103 | ## 贡献代码 104 | 105 | - Fork并克隆到本机 106 | - 创建一个分支并添加你的代码 107 | - 发送一个Pull Request 108 | 109 | ## License 110 | 111 | The MIT license see: [LICENSE](https://github.com/loamen/KeyMouseHook/blob/master/LICENSE) 112 | -------------------------------------------------------------------------------- /documents/images/keyboard-mouse-hook-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loamen/KeyMouseHook/4be4072864d0d15eab72ead21ba22aa31dad1670/documents/images/keyboard-mouse-hook-logo.png -------------------------------------------------------------------------------- /documents/images/screen-shots.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loamen/KeyMouseHook/4be4072864d0d15eab72ead21ba22aa31dad1670/documents/images/screen-shots.png -------------------------------------------------------------------------------- /src/.gitattributes: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Set default behavior to automatically normalize line endings. 3 | ############################################################################### 4 | * text=auto 5 | 6 | ############################################################################### 7 | # Set default behavior for command prompt diff. 8 | # 9 | # This is need for earlier builds of msysgit that does not have it on by 10 | # default for csharp files. 11 | # Note: This is only used by command line 12 | ############################################################################### 13 | #*.cs diff=csharp 14 | 15 | ############################################################################### 16 | # Set the merge driver for project and solution files 17 | # 18 | # Merging from the command prompt will add diff markers to the files if there 19 | # are conflicts (Merging from VS is not affected by the settings below, in VS 20 | # the diff markers are never inserted). Diff markers may cause the following 21 | # file extensions to fail to load in VS. An alternative would be to treat 22 | # these files as binary and thus will always conflict and require user 23 | # intervention with every merge. To do so, just uncomment the entries below 24 | ############################################################################### 25 | #*.sln merge=binary 26 | #*.csproj merge=binary 27 | #*.vbproj merge=binary 28 | #*.vcxproj merge=binary 29 | #*.vcproj merge=binary 30 | #*.dbproj merge=binary 31 | #*.fsproj merge=binary 32 | #*.lsproj merge=binary 33 | #*.wixproj merge=binary 34 | #*.modelproj merge=binary 35 | #*.sqlproj merge=binary 36 | #*.wwaproj merge=binary 37 | 38 | ############################################################################### 39 | # behavior for image files 40 | # 41 | # image files are treated as binary by default. 42 | ############################################################################### 43 | #*.jpg binary 44 | #*.png binary 45 | #*.gif binary 46 | 47 | ############################################################################### 48 | # diff behavior for common document formats 49 | # 50 | # Convert binary document formats to text before diffing them. This feature 51 | # is only available from the command line. Turn it on by uncommenting the 52 | # entries below. 53 | ############################################################################### 54 | #*.doc diff=astextplain 55 | #*.DOC diff=astextplain 56 | #*.docx diff=astextplain 57 | #*.DOCX diff=astextplain 58 | #*.dot diff=astextplain 59 | #*.DOT diff=astextplain 60 | #*.pdf diff=astextplain 61 | #*.PDF diff=astextplain 62 | #*.rtf diff=astextplain 63 | #*.RTF diff=astextplain 64 | -------------------------------------------------------------------------------- /src/.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | 4 | # User-specific files 5 | *.suo 6 | *.user 7 | *.userosscache 8 | *.sln.docstates 9 | 10 | # User-specific files (MonoDevelop/Xamarin Studio) 11 | *.userprefs 12 | 13 | # Build results 14 | [Dd]ebug/ 15 | [Dd]ebugPublic/ 16 | [Rr]elease/ 17 | [Rr]eleases/ 18 | x64/ 19 | x86/ 20 | bld/ 21 | [Bb]in/ 22 | [Oo]bj/ 23 | [Ll]og/ 24 | 25 | # Visual Studio 2015 cache/options directory 26 | .vs/ 27 | # Uncomment if you have tasks that create the project's static files in wwwroot 28 | #wwwroot/ 29 | 30 | # MSTest test Results 31 | [Tt]est[Rr]esult*/ 32 | [Bb]uild[Ll]og.* 33 | 34 | # NUNIT 35 | *.VisualState.xml 36 | TestResult.xml 37 | 38 | # Build Results of an ATL Project 39 | [Dd]ebugPS/ 40 | [Rr]eleasePS/ 41 | dlldata.c 42 | 43 | # DNX 44 | project.lock.json 45 | project.fragment.lock.json 46 | artifacts/ 47 | 48 | *_i.c 49 | *_p.c 50 | *_i.h 51 | *.ilk 52 | *.meta 53 | *.obj 54 | *.pch 55 | *.pdb 56 | *.pgc 57 | *.pgd 58 | *.rsp 59 | *.sbr 60 | *.tlb 61 | *.tli 62 | *.tlh 63 | *.tmp 64 | *.tmp_proj 65 | *.log 66 | *.vspscc 67 | *.vssscc 68 | .builds 69 | *.pidb 70 | *.svclog 71 | *.scc 72 | 73 | # Chutzpah Test files 74 | _Chutzpah* 75 | 76 | # Visual C++ cache files 77 | ipch/ 78 | *.aps 79 | *.ncb 80 | *.opendb 81 | *.opensdf 82 | *.sdf 83 | *.cachefile 84 | *.VC.db 85 | *.VC.VC.opendb 86 | 87 | # Visual Studio profiler 88 | *.psess 89 | *.vsp 90 | *.vspx 91 | *.sap 92 | 93 | # TFS 2012 Local Workspace 94 | $tf/ 95 | 96 | # Guidance Automation Toolkit 97 | *.gpState 98 | 99 | # ReSharper is a .NET coding add-in 100 | _ReSharper*/ 101 | *.[Rr]e[Ss]harper 102 | *.DotSettings.user 103 | 104 | # JustCode is a .NET coding add-in 105 | .JustCode 106 | 107 | # TeamCity is a build add-in 108 | _TeamCity* 109 | 110 | # DotCover is a Code Coverage Tool 111 | *.dotCover 112 | 113 | # NCrunch 114 | _NCrunch_* 115 | .*crunch*.local.xml 116 | nCrunchTemp_* 117 | 118 | # MightyMoose 119 | *.mm.* 120 | AutoTest.Net/ 121 | 122 | # Web workbench (sass) 123 | .sass-cache/ 124 | 125 | # Installshield output folder 126 | [Ee]xpress/ 127 | 128 | # DocProject is a documentation generator add-in 129 | DocProject/buildhelp/ 130 | DocProject/Help/*.HxT 131 | DocProject/Help/*.HxC 132 | DocProject/Help/*.hhc 133 | DocProject/Help/*.hhk 134 | DocProject/Help/*.hhp 135 | DocProject/Help/Html2 136 | DocProject/Help/html 137 | 138 | # Click-Once directory 139 | publish/ 140 | 141 | # Publish Web Output 142 | *.[Pp]ublish.xml 143 | *.azurePubxml 144 | # TODO: Comment the next line if you want to checkin your web deploy settings 145 | # but database connection strings (with potential passwords) will be unencrypted 146 | #*.pubxml 147 | *.publishproj 148 | 149 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 150 | # checkin your Azure Web App publish settings, but sensitive information contained 151 | # in these scripts will be unencrypted 152 | PublishScripts/ 153 | 154 | # NuGet Packages 155 | *.nupkg 156 | # The packages folder can be ignored because of Package Restore 157 | **/packages/* 158 | # except build/, which is used as an MSBuild target. 159 | !**/packages/build/ 160 | # Uncomment if necessary however generally it will be regenerated when needed 161 | #!**/packages/repositories.config 162 | # NuGet v3's project.json files produces more ignoreable files 163 | *.nuget.props 164 | *.nuget.targets 165 | 166 | # Microsoft Azure Build Output 167 | csx/ 168 | *.build.csdef 169 | 170 | # Microsoft Azure Emulator 171 | ecf/ 172 | rcf/ 173 | 174 | # Windows Store app package directories and files 175 | AppPackages/ 176 | BundleArtifacts/ 177 | Package.StoreAssociation.xml 178 | _pkginfo.txt 179 | 180 | # Visual Studio cache files 181 | # files ending in .cache can be ignored 182 | *.[Cc]ache 183 | # but keep track of directories ending in .cache 184 | !*.[Cc]ache/ 185 | 186 | # Others 187 | ClientBin/ 188 | ~$* 189 | *~ 190 | *.dbmdl 191 | *.dbproj.schemaview 192 | *.jfm 193 | *.pfx 194 | *.publishsettings 195 | node_modules/ 196 | orleans.codegen.cs 197 | 198 | # Since there are multiple workflows, uncomment next line to ignore bower_components 199 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 200 | #bower_components/ 201 | 202 | # RIA/Silverlight projects 203 | Generated_Code/ 204 | 205 | # Backup & report files from converting an old project file 206 | # to a newer Visual Studio version. Backup files are not needed, 207 | # because we have git ;-) 208 | _UpgradeReport_Files/ 209 | Backup*/ 210 | UpgradeLog*.XML 211 | UpgradeLog*.htm 212 | 213 | # SQL Server files 214 | *.mdf 215 | *.ldf 216 | 217 | # Business Intelligence projects 218 | *.rdl.data 219 | *.bim.layout 220 | *.bim_*.settings 221 | 222 | # Microsoft Fakes 223 | FakesAssemblies/ 224 | 225 | # GhostDoc plugin setting file 226 | *.GhostDoc.xml 227 | 228 | # Node.js Tools for Visual Studio 229 | .ntvs_analysis.dat 230 | 231 | # Visual Studio 6 build log 232 | *.plg 233 | 234 | # Visual Studio 6 workspace options file 235 | *.opt 236 | 237 | # Visual Studio LightSwitch build output 238 | **/*.HTMLClient/GeneratedArtifacts 239 | **/*.DesktopClient/GeneratedArtifacts 240 | **/*.DesktopClient/ModelManifest.xml 241 | **/*.Server/GeneratedArtifacts 242 | **/*.Server/ModelManifest.xml 243 | _Pvt_Extensions 244 | 245 | # Paket dependency manager 246 | .paket/paket.exe 247 | paket-files/ 248 | 249 | # FAKE - F# Make 250 | .fake/ 251 | 252 | # JetBrains Rider 253 | .idea/ 254 | *.sln.iml 255 | 256 | # CodeRush 257 | .cr/ 258 | 259 | # Python Tools for Visual Studio (PTVS) 260 | __pycache__/ 261 | *.pyc -------------------------------------------------------------------------------- /src/Examples/ConsoleExample/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /src/Examples/ConsoleExample/ConsoleExample.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {8C561730-2800-4C20-BBC4-D5B7F3631C37} 8 | Exe 9 | ConsoleExample 10 | ConsoleExample 11 | v4.6 12 | 512 13 | true 14 | 15 | 16 | AnyCPU 17 | true 18 | full 19 | false 20 | bin\Debug\ 21 | DEBUG;TRACE 22 | prompt 23 | 4 24 | true 25 | 26 | 27 | AnyCPU 28 | pdbonly 29 | true 30 | bin\Release\ 31 | TRACE 32 | prompt 33 | 4 34 | 35 | 36 | 37 | ..\..\packages\MouseKeyHook.5.6.0\lib\net40\Gma.System.MouseKeyHook.dll 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | {f872eba8-cfc4-4abd-8c45-7b5f091e794a} 61 | KeyMouseHook 62 | 63 | 64 | 65 | -------------------------------------------------------------------------------- /src/Examples/ConsoleExample/LogKeys.cs: -------------------------------------------------------------------------------- 1 | using Gma.System.MouseKeyHook; 2 | using Loamen.KeyMouseHook; 3 | using Loamen.KeyMouseHook.Native; 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Linq; 7 | using System.Text; 8 | using System.Threading; 9 | using System.Threading.Tasks; 10 | using System.Windows.Forms; 11 | 12 | namespace ConsoleExample 13 | { 14 | internal class LogKeys 15 | { 16 | public static void Record(Action action) 17 | { 18 | Console.WriteLine("Press " + Program.exitChar + " to quit."); 19 | KeyMouseFactory eventHookFactory = new KeyMouseFactory(Hook.GlobalEvents()); 20 | KeyboardWatcher keyboardWatcher = eventHookFactory.GetKeyboardWatcher().Disable(MacroEventType.KeyDown| MacroEventType.KeyUp).Enable(MacroEventType.KeyPress); 21 | Program._macroEvents = new List(); 22 | keyboardWatcher.OnKeyboardInput += (s, e) => 23 | { 24 | Program._macroEvents.Add(e); 25 | 26 | if (e.KeyMouseEventType == MacroEventType.KeyPress) 27 | { 28 | var keyEvent = (KeyPressEventArgs)e.EventArgs; 29 | Console.Write(string.Format("Key {0}\t\t{1}\n", keyEvent.KeyChar, e.KeyMouseEventType)); 30 | //var ch = Console.ReadKey(true).KeyChar; 31 | if (keyEvent.KeyChar == Program.exitChar) 32 | { 33 | keyboardWatcher.Stop(); 34 | eventHookFactory.Dispose(); 35 | Console.Clear(); 36 | Console.WriteLine("Record stopped"); 37 | Program.ConsoleLine(); 38 | action(); 39 | return; 40 | } 41 | } 42 | }; 43 | keyboardWatcher.Start(); 44 | } 45 | 46 | public static void Playback(Action quit) 47 | { 48 | PlayBack(Program._macroEvents, quit); 49 | } 50 | 51 | private static void PlayBack(List mouseKeyEventList,Action quit) 52 | { 53 | if (mouseKeyEventList == null || mouseKeyEventList.Count == 0) 54 | { 55 | Console.Write("Exiting"); 56 | Wait(3); 57 | Environment.Exit(0); 58 | } 59 | else 60 | { 61 | if (mouseKeyEventList.Count > 0) 62 | { 63 | foreach (MacroEvent mouseKeyEvent in mouseKeyEventList) 64 | { 65 | #region Mouse simulator 66 | Thread.Sleep(mouseKeyEvent.TimeSinceLastEvent); 67 | 68 | switch (mouseKeyEvent.KeyMouseEventType) 69 | { 70 | case MacroEventType.KeyPress: 71 | { 72 | KeyPressEventArgs ergs = (KeyPressEventArgs)mouseKeyEvent.EventArgs; 73 | 74 | Console.WriteLine(string.Format("Input {0}\t\t{1}", ergs.KeyChar, mouseKeyEvent.KeyMouseEventType)); 75 | if (ergs.KeyChar == Program.exitChar) 76 | { 77 | Program.ConsoleLine(); 78 | Console.Write("Playback completed"); 79 | Wait(3); 80 | quit(); 81 | } 82 | } 83 | break; 84 | default: 85 | break; 86 | } 87 | #endregion 88 | } 89 | } 90 | } 91 | } 92 | 93 | private static void Wait(int seconds) 94 | { 95 | for (int i = 0; i < seconds; i++) 96 | { 97 | Console.Write("."); 98 | Thread.Sleep(1000); 99 | } 100 | } 101 | } 102 | } -------------------------------------------------------------------------------- /src/Examples/ConsoleExample/Program.cs: -------------------------------------------------------------------------------- 1 | using Loamen.KeyMouseHook; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Threading; 6 | using System.Windows.Forms; 7 | 8 | namespace ConsoleExample 9 | { 10 | class Program 11 | { 12 | internal static List _macroEvents = new List(); 13 | internal const char exitChar = 'Q'; 14 | 15 | internal static void Main(string[] args) 16 | { 17 | ShowMenu(); 18 | Application.Run(new ApplicationContext()); 19 | } 20 | 21 | private static void ShowMenu() 22 | { 23 | var selector = new Dictionary> 24 | { 25 | {"1. Record keys", LogKeys.Record}, 26 | {"2. Playback", LogKeys.Playback}, 27 | {exitChar + ". Quit", Exit} 28 | }; 29 | 30 | Console.WriteLine("Please select one of these:"); 31 | foreach (var selectorKey in selector.Keys) 32 | Console.WriteLine(selectorKey); 33 | 34 | Action action = null; 35 | 36 | while (action == null) 37 | { 38 | var ch = Console.ReadKey(true).KeyChar; 39 | action = selector 40 | .Where(p => p.Key.StartsWith(ch.ToString())) 41 | .Select(p => p.Value).FirstOrDefault(); 42 | } 43 | ConsoleLine(); 44 | if (action == LogKeys.Record) 45 | action(ShowMenu); 46 | else 47 | action(Application.Exit); 48 | } 49 | 50 | private static void Exit(Action quit) 51 | { 52 | Environment.Exit(0); 53 | } 54 | 55 | internal static void ConsoleLine() 56 | { 57 | Console.WriteLine("--------------------------------------------------"); 58 | } 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /src/Examples/ConsoleExample/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // 有关程序集的一般信息由以下 6 | // 控制。更改这些特性值可修改 7 | // 与程序集关联的信息。 8 | [assembly: AssemblyTitle("ConsoleExample")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("ConsoleExample")] 13 | [assembly: AssemblyCopyright("Copyright © 2018")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // 将 ComVisible 设置为 false 会使此程序集中的类型 18 | //对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型 19 | //请将此类型的 ComVisible 特性设置为 true。 20 | [assembly: ComVisible(false)] 21 | 22 | // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID 23 | [assembly: Guid("8c561730-2800-4c20-bbc4-d5b7f3631c37")] 24 | 25 | // 程序集的版本信息由下列四个值组成: 26 | // 27 | // 主版本 28 | // 次版本 29 | // 生成号 30 | // 修订号 31 | // 32 | // 可以指定所有值,也可以使用以下所示的 "*" 预置版本号和修订号 33 | // 方法是按如下所示使用“*”: : 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /src/Examples/ConsoleExample/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /src/Examples/WinformExample/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /src/Examples/WinformExample/FormMain.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | -------------------------------------------------------------------------------- /src/Examples/WinformExample/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using System.Windows.Forms; 6 | 7 | namespace WinformExample 8 | { 9 | static class Program 10 | { 11 | /// 12 | /// 应用程序的主入口点。 13 | /// 14 | [STAThread] 15 | static void Main() 16 | { 17 | Application.EnableVisualStyles(); 18 | Application.SetCompatibleTextRenderingDefault(false); 19 | Application.Run(new FormMain()); 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/Examples/WinformExample/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // 有关程序集的一般信息由以下 6 | // 控制。更改这些特性值可修改 7 | // 与程序集关联的信息。 8 | [assembly: AssemblyTitle("WinformExample")] 9 | [assembly: AssemblyDescription("KeyMouseHook windows form example")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Loamen.com")] 12 | [assembly: AssemblyProduct("WinformExample")] 13 | [assembly: AssemblyCopyright("Copyright © 2018")] 14 | [assembly: AssemblyTrademark("Loamen.com")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // 将 ComVisible 设置为 false 会使此程序集中的类型 18 | //对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型 19 | //请将此类型的 ComVisible 特性设置为 true。 20 | [assembly: ComVisible(false)] 21 | 22 | // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID 23 | [assembly: Guid("219ea77d-db1f-4414-a3c9-cfc509a553aa")] 24 | 25 | // 程序集的版本信息由下列四个值组成: 26 | // 27 | // 主版本 28 | // 次版本 29 | // 生成号 30 | // 修订号 31 | // 32 | // 可以指定所有值,也可以使用以下所示的 "*" 预置版本号和修订号 33 | // 方法是按如下所示使用“*”: : 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.*")] 36 | [assembly: AssemblyFileVersion("1.0.0")] 37 | -------------------------------------------------------------------------------- /src/Examples/WinformExample/Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // 此代码由工具生成。 4 | // 运行时版本: 4.0.30319.42000 5 | // 6 | // 对此文件的更改可能导致不正确的行为,如果 7 | // 重新生成代码,则所做更改将丢失。 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace WinformExample.Properties 12 | { 13 | 14 | 15 | /// 16 | /// 强类型资源类,用于查找本地化字符串等。 17 | /// 18 | // 此类是由 StronglyTypedResourceBuilder 19 | // 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。 20 | // 若要添加或删除成员,请编辑 .ResX 文件,然后重新运行 ResGen 21 | // (以 /str 作为命令选项),或重新生成 VS 项目。 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal class Resources 26 | { 27 | 28 | private static global::System.Resources.ResourceManager resourceMan; 29 | 30 | private static global::System.Globalization.CultureInfo resourceCulture; 31 | 32 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 33 | internal Resources() 34 | { 35 | } 36 | 37 | /// 38 | /// 返回此类使用的缓存 ResourceManager 实例。 39 | /// 40 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 41 | internal static global::System.Resources.ResourceManager ResourceManager 42 | { 43 | get 44 | { 45 | if ((resourceMan == null)) 46 | { 47 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("WinformExample.Properties.Resources", typeof(Resources).Assembly); 48 | resourceMan = temp; 49 | } 50 | return resourceMan; 51 | } 52 | } 53 | 54 | /// 55 | /// 覆盖当前线程的 CurrentUICulture 属性 56 | /// 使用此强类型的资源类的资源查找。 57 | /// 58 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 59 | internal static global::System.Globalization.CultureInfo Culture 60 | { 61 | get 62 | { 63 | return resourceCulture; 64 | } 65 | set 66 | { 67 | resourceCulture = value; 68 | } 69 | } 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /src/Examples/WinformExample/Properties/Resources.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | text/microsoft-resx 107 | 108 | 109 | 2.0 110 | 111 | 112 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 113 | 114 | 115 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | -------------------------------------------------------------------------------- /src/Examples/WinformExample/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace WinformExample.Properties 12 | { 13 | 14 | 15 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 16 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] 17 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase 18 | { 19 | 20 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 21 | 22 | public static Settings Default 23 | { 24 | get 25 | { 26 | return defaultInstance; 27 | } 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/Examples/WinformExample/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /src/Examples/WinformExample/WinformExample.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {219EA77D-DB1F-4414-A3C9-CFC509A553AA} 8 | WinExe 9 | WinformExample 10 | WinformExample 11 | v4.6 12 | 512 13 | true 14 | 15 | 16 | AnyCPU 17 | true 18 | full 19 | false 20 | bin\Debug\ 21 | DEBUG;TRACE 22 | prompt 23 | 4 24 | true 25 | 26 | 27 | AnyCPU 28 | pdbonly 29 | true 30 | bin\Release\ 31 | TRACE 32 | prompt 33 | 4 34 | 35 | 36 | 37 | ..\..\packages\MouseKeyHook.5.6.0\lib\net40\Gma.System.MouseKeyHook.dll 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | Form 55 | 56 | 57 | FormMain.cs 58 | 59 | 60 | 61 | 62 | FormMain.cs 63 | 64 | 65 | ResXFileCodeGenerator 66 | Resources.Designer.cs 67 | Designer 68 | 69 | 70 | True 71 | Resources.resx 72 | 73 | 74 | 75 | SettingsSingleFileGenerator 76 | Settings.Designer.cs 77 | 78 | 79 | True 80 | Settings.settings 81 | True 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | {f872eba8-cfc4-4abd-8c45-7b5f091e794a} 90 | KeyMouseHook 91 | 92 | 93 | 94 | -------------------------------------------------------------------------------- /src/Examples/WinformExample/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /src/Examples/WpfExample/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /src/Examples/WpfExample/App.xaml: -------------------------------------------------------------------------------- 1 |  6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /src/Examples/WpfExample/App.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Configuration; 4 | using System.Data; 5 | using System.Linq; 6 | using System.Threading.Tasks; 7 | using System.Windows; 8 | 9 | namespace WpfExample 10 | { 11 | /// 12 | /// App.xaml 的交互逻辑 13 | /// 14 | public partial class App : Application 15 | { 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/Examples/WpfExample/MainWindow.xaml: -------------------------------------------------------------------------------- 1 |  9 | 10 | 11 | 12 | 13 | 14 |