public const byte VK_NONAME = 0xFC; // 什么也不做
public const byte VK_ESC = 0x1B; // Smartphone的回退键
public const byte VK_F4 = 0x73; // Home Screen
public const byte VK_APP6 = 0xC6; // Smartphone上锁定键盘
public const byte VK_F22 = 0x85; // PocketPC上锁定键盘(VK_KEYLOCK)
public const byte VK_F16 = 0x7F; // 出发扬声器
public const byte VK_OFF = 0x7F; //电源键
public const byte VK_TSOFT1 = 0x70;
public const byte VK_TSOFT2 = 0x71;
public const byte VK_TTALK = 0x72;
public const byte VK_TEND = 0x73;
/// <summary>
/// 将按键送至全局键盘缓冲区
/// </summary>
/// <param name="key"></param>
public static void SendKey(byte key)
{
//const byte KEYEVENTF_SILENT = 0x0004;
const int KEYEVENTF_KEYUP = 0x02;
const int KEYEVENTF_KEYDOWN = 0x00;
keybd_event(key, 0, KEYEVENTF_KEYDOWN, 0);
keybd_event(key, 0, KEYEVENTF_KEYUP, 0);
}
[DllImport("coredll", SetLastError = true)]
private static extern void keybd_event(byte bVk, byte bScan, int dwFlags, int dwExtraInfo);
private void button1_Click(object sender, EventArgs e)
{
SendKey(VK_TTALK);
}