资源简介
简洁高效,利用全局键盘钩子监听键盘输入,在钩子回调函数中利用时间差判断输入字符的连续性来区别扫描枪输入,相关文章在本人博客
代码片段和文件信息
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Runtime.InteropServices;
using System.Reflection;
using System.Diagnostics;
using Microsoft.Win32;
namespace KeyboardHookTest
{
public partial class Form1 : Form
{
private KeyboardHookLib _keyboardHook = null;
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender EventArgs e)
{
//安装勾子
_keyboardHook = new KeyboardHookLib();
_keyboardHook.InstallHook(this.KeyPress);
}
private void button2_Click(object sender EventArgs e)
{
//卸载钩子
if (_keyboardHook != null) _keyboardHook.UninstallHook();
}
///
/// 刷枪输入判断函数
///
///
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 11776 2018-01-12 15:21 KeyboardHookTest\KeyboardHookTest\bin\Debug\KeyboardHookTest.exe
文件 34304 2018-01-12 15:21 KeyboardHookTest\KeyboardHookTest\bin\Debug\KeyboardHookTest.pdb
文件 24216 2018-01-12 15:22 KeyboardHookTest\KeyboardHookTest\bin\Debug\KeyboardHookTest.vshost.exe
文件 490 2014-01-13 21:31 KeyboardHookTest\KeyboardHookTest\bin\Debug\KeyboardHookTest.vshost.exe.manifest
文件 2665 2018-01-12 15:21 KeyboardHookTest\KeyboardHookTest\Form1.cs
文件 3669 2018-01-12 11:10 KeyboardHookTest\KeyboardHookTest\Form1.Designer.cs
文件 5817 2018-01-12 15:21 KeyboardHookTest\KeyboardHookTest\Form1.resx
文件 4822 2018-01-12 14:43 KeyboardHookTest\KeyboardHookTest\KeyboardHookLib.cs
文件 3792 2018-01-08 16:30 KeyboardHookTest\KeyboardHookTest\KeyboardHookTest.csproj
文件 1453 2018-01-12 10:45 KeyboardHookTest\KeyboardHookTest\obj\Debug\DesignTimeResolveAssemblyReferences.cache
文件 6881 2018-01-12 15:20 KeyboardHookTest\KeyboardHookTest\obj\Debug\DesignTimeResolveAssemblyReferencesInput.cache
文件 1988 2018-01-12 15:22 KeyboardHookTest\KeyboardHookTest\obj\Debug\KeyboardHookTest.csproj.FileListAbsolute.txt
文件 977 2018-01-12 15:21 KeyboardHookTest\KeyboardHookTest\obj\Debug\KeyboardHookTest.csproj.GenerateResource.Cache
文件 2211 2018-01-08 16:23 KeyboardHookTest\KeyboardHookTest\obj\Debug\KeyboardHookTest.csprojResolveAssemblyReference.cache
文件 11776 2018-01-12 15:21 KeyboardHookTest\KeyboardHookTest\obj\Debug\KeyboardHookTest.exe
文件 180 2018-01-12 15:21 KeyboardHookTest\KeyboardHookTest\obj\Debug\KeyboardHookTest.Form1.resources
文件 34304 2018-01-12 15:21 KeyboardHookTest\KeyboardHookTest\obj\Debug\KeyboardHookTest.pdb
文件 180 2018-01-08 16:30 KeyboardHookTest\KeyboardHookTest\obj\Debug\KeyboardHookTest.Properties.Resources.resources
文件 497 2018-01-08 16:16 KeyboardHookTest\KeyboardHookTest\Program.cs
文件 1356 2018-01-08 16:16 KeyboardHookTest\KeyboardHookTest\Properties\AssemblyInfo.cs
文件 2884 2018-01-08 16:16 KeyboardHookTest\KeyboardHookTest\Properties\Resources.Designer.cs
文件 5612 2018-01-08 16:16 KeyboardHookTest\KeyboardHookTest\Properties\Resources.resx
文件 1103 2018-01-08 16:16 KeyboardHookTest\KeyboardHookTest\Properties\Settings.Designer.cs
文件 249 2018-01-08 16:16 KeyboardHookTest\KeyboardHookTest\Properties\Settings.settings
文件 1017 2018-01-08 16:16 KeyboardHookTest\KeyboardHookTest.sln
..A..H. 39936 2018-01-12 15:15 KeyboardHookTest\KeyboardHookTest.v12.suo
目录 0 2018-01-08 16:16 KeyboardHookTest\KeyboardHookTest\obj\Debug\TempPE
目录 0 2018-01-12 15:19 KeyboardHookTest\KeyboardHookTest\bin\Debug
目录 0 2018-01-12 15:21 KeyboardHookTest\KeyboardHookTest\obj\Debug
目录 0 2018-01-12 15:19 KeyboardHookTest\KeyboardHookTest\bin
............此处省略7个文件信息
- 上一篇:风机三维模型
- 下一篇:基于matalb神经网络预测控制
相关资源
- 暗影2MAC12系统安装clover.zip
- fdt_4_09_03.exe
- pkg-win.zip
- PRML最全资料集合.zip
- 数据可视化驾驶舱.zip
- 李晓峰通信原理.zip
- 图解西门子S71200PLC入门到实践(清晰
- AI拓客商家联盟V2.1.3前端+后端.rar
- echarts大数据领导仓demo.rar
- [C51单片机开发工具Keil.UV4].Keil.C51.V9
- Deep_Learning_2016.pdf
- zw_Classification1.zip
- Griffiths-IntroductiontoElectrodynamics4thEdit
- ParaViewTutorial.pdf
- xyisv_10236804.zip
- 计算机图形学第4版高清电子书.pdf
- 《多粒度知识获取与不确定性度量》
- 华成英模电课件.zip
- 70d0cd041f738f12db575d3b46e97582.pdf
- OfficeTabEnterprise13.1.zip
- wxu998.rar
- PowerDesigner16.5汉化文件.rar
- jsgis.zip
- PinyinIME(关键代码写了注释).zip
- 锁相环设计、仿真与应用第5版中.pd
- novelOnLine.zip
- SingleSensorImagingMethodsandApplicationsforDi
- ControlSystemsEngineering7th(NormanS.Nise)
- ModernControlSystems13th(RichardC.Dorf).ra
- VectorMagic_1.15pojie.rar
评论
共有 条评论