procedure TForm1.ButtonPen1Click(Sender: TObject); begin SetCursorPos(694, 352); //设置开始的位置。 Sleep(300); // mouse_event(MOUSEEVENTF_RIGHTDOWN, 0, 0, 0, 0); //模拟按下鼠标右键。 // mouse_event(MOUSEEVENTF_RIGHTUP, 0, 0, 0, 0); //模拟放开鼠标右键。 mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0); //模拟按下鼠标左键。 mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0); //模拟放开鼠标左键。 keybd_event(VK_SHIFT, MapVirtualKey(VK_SHIFT, 0), 0, 0); //按下SHIFT键。 SetCursorPos(768, 352); //设置结束的位置。 mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0); //模拟按下鼠标左键。 mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0); //模拟放开鼠标左键。 // keybd_event(0x52, MapVirtualKey(0 x52, 0), 0, 0); //按下R键。 // keybd_event(0x52, MapVirtualKey(0 x52, 0), KEYEVENTF_KEYUP, 0); //放开R键。 keybd_event(VK_SHIFT, MapVirtualKey(VK_SHIFT, 0), KEYEVENTF_KEYUP, 0); //放开SHIFT键。 end;
标签:MOUSEEVENTF,鼠标,SHIFT,delphi,按下,shift,mouse,event,键配合 From: https://www.cnblogs.com/yehuiyan/p/18282359