[ctypes-users] creating a Ctypes.windll.user32.sendinput command
Brought to you by:
theller
From: Michael C <mys...@gm...> - 2016-11-29 03:08:09
|
Hi all: I am trying to create a combined sendinput function with holding down right mouse button, moving the mouse, and releasing the mouse button inside ONE sendinput functon. Here is my current code: import ctypes INPUT mouseinput input.type = INPUT_MOUSE input.mi.dx = 0 input.mi.dy = 0 input.mi.dwFlags = MOUSEEVENTF_RIGHTDOWN input.mi.time = 10 input.mi.time = 0 #Sleep(50); input.type = INPUT_MOUSE input.mi.dx = 100 input.mi.dy = 0 input.mi.dwFlags = MOUSEEVENTF_MOVE input.mi.time = 10 #Sleep(50); input.type = INPUT_MOUSE input.mi.dx = 0 input.mi.dy = 0 input.mi.dwFlags = MOUSEEVENTF_RIGHTUP input.mi.time = 0 SendInput(3, &input, sizeof(input)); This part by itself pops a syntax error: import ctypes INPUT mouseinput How do I create an array of this type? https://msdn.microsoft.com/en-us/library/windows/desktop/ms646310(v=vs.85).aspxhttps://msdn.microsoft.com/en-us/library/windows/desktop/ms646270(v=vs.85).aspx thx all! |