creating a Ctypes.windll.user32.sendinput command

Michael C <[email protected]> Mon, 28 Nov 2016 19:08:02 -0800
Newsgroups gmane.comp.python.ctypes
Message-ID <CANyKM1hWLxY1UMBP6PA4dkr6f3EiMa_awSb8HSjoxMxAHcwefw@mail.gmail.com>
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!

------------------------------------------------------------------------------

_______________________________________________
ctypes-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ctypes-users