模拟键盘按键自动输入文字,焦点文字,模拟键盘输入
2023-11-30 12:06:03 256KB 模拟键盘按键自动输入文字
1
using System; using System.Runtime.InteropServices; using System.Reflection; using System.Windows.Forms; namespace KeyboardHook { public enum KeyboardEvents { KeyDown = 0x0100, KeyUp = 0x0101, SystemKeyDown = 0x0104, SystemKeyUp = 0x0105 } [StructLayout(LayoutKind.Sequential)] public struct KeyboardHookStruct { public int vkCode; //表示一个在1到254间的虚似键盘码 public int scanCode; //表示硬件扫描码 public int flags; public int time; public int dwExtraInfo; } public delegate void KeyboardEventHandler(KeyboardEvents keyEvent, System.Windows.Forms.Keys key); public class Hook { public event KeyboardEventHandler KeyboardEvent; public enum HookType { WH_JOURNALRECORD = 0, WH_JOURNALPLAYBACK = 1, WH_KEYBOARD = 2, WH_GETMESSAGE = 3, WH_CALLWNDPROC = 4, WH_CBT = 5, WH_SYSMSGFILTER = 6, WH_MOUSE = 7, WH_HARDWARE = 8, WH_DEBUG = 9, WH_SHELL = 10, WH_FOREGROUNDIDLE = 11, WH_CALLWNDPROCRET = 12, WH_KEYBOARD_LL = 13, WH_MOUSE_LL = 14, WH_MSGFILTER = -1, } public delegate IntPtr HookProc(int code, int wParam, IntPtr lParam); [DllImport("User32.dll", CharSet = CharSet.Auto)] public static extern IntPtr SetWindowsHookEx(HookType hookType, HookProc hook, IntPtr instance, int threadID); [DllImport("User32.dll", CharSet = CharSet.Auto)] public static extern IntPtr CallNextHookEx(IntPtr hookHandle, int code, int wParam, IntPtr lParam); [DllImport("User32.dll", CharSet = CharSet.Auto)] public static extern bool UnhookWindowsHookEx(IntPtr hookHandle); private IntPtr instance; private IntPtr hookHandle; private int threadID; private HookProc hookProcEx; public Hook() { this.instance = Marshal.GetHINSTANCE(Assembly.GetExecutingAssembly().GetModules()[0]); this.threadID = 0; hookHandle = IntPtr.Zero; hookProcEx = new HookProc(hookProc); } public bool SetHook() { this.hookHandle = SetWindowsHookEx(HookType.WH_KEYBOARD_LL, hookProcEx, this.instance, this.threadID); return ((int)hookHandle != 0); } public IntPtr hookProc(int code, int wParam, IntPtr lParam) { if (code >= 0) { KeyboardEvents kEvent = (KeyboardEvents)wParam; if (kEvent != KeyboardEvents.KeyDown && kEvent != KeyboardEvents.KeyUp && kEvent != KeyboardEvents.SystemKeyDown && kEvent != KeyboardEvents.SystemKeyUp) { return CallNextHookEx(this.hookHandle, (int)HookType.WH_KEYBOARD_LL, wParam, lParam); } KeyboardHookStruct MyKey = new KeyboardHookStruct(); Type t = MyKey.GetType(); MyKey = (KeyboardHookStruct)Marshal.PtrToStructure(lParam, t); Keys keyData = (Keys)MyKey.vkCode; KeyboardEvent(kEvent, keyData); } return CallNextHookEx(this.hookHandle, (int)HookType.WH_KEYBOARD_LL, wParam, lParam); } public bool UnHook() { return Hook.UnhookWindowsHookEx(this.hookHandle); } } }
2023-11-30 05:06:49 70KB 键盘钩子
1
1. 开发环境: 基于 VS2019 基于C#语言 2. 解决问题 不需要键盘,直接用鼠标模拟键盘发射数字 3、源代码讲解地址: https://blog.csdn.net/hgaohr1021/article/details/129022488?spm=1001.2014.3001.5502
2023-11-26 11:44:51 40KB 模拟键盘
1
摘要:HA7279A是一种智能键盘和LED专用控制芯片,它带有串行接口,可同时驱动8位共阴式数码管或64只独立LED。文中详述了该芯片的工作原理、工作时序及控制指令,给出了HD7279A与CPU的实际接口电路及设计程序,同时指出了实际应用中的一些注意事项。 关键词:HD7279A;工作时序;接口电路1 主要特性HD7279A是比高公司生产的单片具有串行接口、可同时驱动8位共阴式数码管(或64只独立LED)的智能显示驱动芯片,该芯片同时可连接多达64键的键盘矩阵,一片即可完成LED显示及键盘接口的全部功能。HD7279A和微处理器之间采用串行接口,其接口和外围电路比较简单,且占用口线少,加
1
这是 Visual C++ 典型模块与项目实战大全 清华大学出版社 第11章 截屏工具(动态链接库+键盘钩子+光标捕获+类橡皮类CRectTracker) 源码,为了防止光盘丢失,特存于此。
1
layui手机车牌号码键盘代码是一款基于jQuery跟layui制作的手机端车牌号码输入弹出键盘选择,支持新能源汽车车牌输入格式代码。
2023-11-17 10:17:32 55KB jQuery layui 车牌输入 jQuery特效
1
C#键盘鼠标钩子,可以知道键盘和鼠标的动作, 本人根据这个工具,制作成了不用鼠标键盘五分钟 用友自动退出工具 当然了,还可以做成很多程序! QQ交流:873968102
2023-11-12 13:12:28 98KB 键盘鼠标钩子 C#钩子
1
适合触摸屏用的数字小键盘,labview作的。具有自动躲避输入框的功能,并且具有数值上下限功能。做项目时一直使用。
2023-11-12 11:05:24 40KB labview 虚拟键盘 触摸屏虚拟键盘
1
Qt EventFilter 事件过滤器 及传递 鼠标键盘事件捕捉; https://blog.csdn.net/q610098308/article/details/126302939
2023-11-09 17:11:42 7KB EventFilter
1
12864 图形温度计 ds1302 ds18b20 矩阵键盘
2023-10-25 10:28:25 82KB 12864 图形温度计 ds1302 ds18b20
1