1.调用GetAsyncKeyState()获取指定按键的状态,GetActiveKey()检索指定范围内的按键状态 2.调用keybd_event()可合成一次击键事件,通常两次击键事件间需要设定时间间隔 3.调用MapVirtualKey()获取指定按键的硬件扫描码,传入keybd_event()第二个参数就可以对DirectInput有效. Public Class ImitateKeyClass Private Declare Sub keybd_event Lib "user32&qu…
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Windows.Forms; using System.Runtime.InteropServices; using System.ComponentModel; using System.Reflection; namespace Alif.CommonAPI.WindowsAPI { /// <s…