我目前的代码是:
[DllImport("user32.dll", SetLastError = true)]
static extern void keybd_event(byte bVk, byte bScan, int dwFlags, int dwExtraInfo);
public const int KEYEVENTF_EXTENDEDKEY = 0x0001; //Key down flag
public const int KEYEVENTF_KEYUP = 0x0002; //Key up flag
public const int VK_RMENU = 0xA5;
keybd_event(VK_SHIFT, 0, KEYEVENTF_EXTENDEDKEY, 0);
keybd_event(VK_Q, 0, KEYEVENTF_EXTENDEDKEY, 0);
keybd_event(VK_Q, 0, KEYEVENTF_KEYUP, 0);
keybd_event(VK_SHIFT, 0, KEYEVENTF_KEYUP, 0);
我根据需要得到大写 Q,但问题是,“Shift”坚持。
之后的所有字母都是大写。获得小写字母的唯一方法是更改为大写锁定。我怎么解决这个问题?
提前致谢