我想知道是否可以在单击鼠标时按住 shift 键。
它看起来与此类似: - 如果您可以使用 SendKeys.SendWait 函数模拟鼠标点击 -SendKeys.SendWait(+{Mouseclick});
到目前为止,我已经调用了 API“User32.dll”来调用鼠标点击:
public const int MOUSEEVENTF_LEFTDOWN = 0x2;
public const int MOUSEEVENTF_LEFTUP = 0x4;
public const int MOUSEEVENTF_MIDDLEDOWN = 0x20;
public const int MOUSEEVENTF_MIDDLEUP = 0x40;
public const int MOUSEEVENTF_RIGHTDOWN = 0x8;
public const int MOUSEEVENTF_RIGHTUP = 0x10;
[DllImport("User32.dll")]
public static extern int mouse_event(int dwFlags, int dx, int dy, int cButton, int dwExtra);
mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0);
mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0);
然而; 是否可以同时按住Shift键?
问候, DotTutorials