def _sendMouseEvent(ev, x, y, dwData=0):
assert x != None and y != None, 'x and y cannot be set to None'
width, height = _size()
convertedX = 65536 * x // width + 1
convertedY = 65536 * y // height + 1
ctypes.windll.user32.mouse_event(ev, ctypes.c_long(convertedX), ctypes.c_long(convertedY), dwData, 0)
它是一个win32API,内部调用SendInput。在
The SendInput function will insert input events into the same queue as a hardware device but the events are marked with a LLMHF_INJECTED flag that can be detected by hooks. To avoid this flag you probably have to write a custom driver.
Pyautogui
的源代码它是一个win32API,内部调用
SendInput
。在关于如何在DirectX游戏中模拟键盘有很多答案和问题,有人说可以,也有人说不能。你可以试试这个an answer which say could
但在我看来,游戏必须使用directx接口与硬件进行通信以提高速度,那么
SendInput
只在消息中插入事件排队你想用SendInput
或Mouse_Event
。正如俗话所说让我们为游戏添加一个消息队列。在
怎么做的?VMware。完成了。在
相关问题 更多 >
编程相关推荐