I'm experiencing a strange problem occuring in the SendInput function of Key.py. Actually I'vre tryied different codes, and the problem concerns the last part of the function Keys.SendInput()
I get this error : line 468, in SendInput return ctypes.windll.user32.SendInput(nInputs, pInputs, cbSize) ctypes.ArgumentError: argument 2: <class 'TypeError'>: expected LP_INPUT instance instead of INPUT_Array_1
I've tryied using ctypes.pointer to create an LP_Pointer on the inputs, but I get another error saying that the function is waiting for "An instance of LP_Pointer instead of LP_Pointer". Didn't manage to create one though, as LP_Pointer is "not instanciable" ,according to my intepretor.
I have tryied many codes and used google several time before asking, I always fallback on this problem. I think that I might not be the only one concerned by it in the future. Any ideas?
Hi !
I'm experiencing a strange problem occuring in the SendInput function of Key.py. Actually I'vre tryied different codes, and the problem concerns the last part of the function Keys.SendInput()
def SendInput(self, *inputs): nInputs = len(inputs) LPINPUT = INPUT * nInputs pInputs = LPINPUT(*inputs) cbSize = ctypes.c_int(ctypes.sizeof(INPUT)) return ctypes.windll.user32.SendInput(nInputs, pInputs, cbSize)
The following function, sending the keyboard inputs to the drivers, is actually the problematic one.
ctypes.windll.user32.SendInput(nInputs, pInputs, cbSize)
I get this error :
line 468, in SendInput return ctypes.windll.user32.SendInput(nInputs, pInputs, cbSize) ctypes.ArgumentError: argument 2: <class 'TypeError'>: expected LP_INPUT instance instead of INPUT_Array_1
I've tryied using
ctypes.pointer
to create an LP_Pointer on the inputs, but I get another error saying that the function is waiting for "An instance of LP_Pointer instead of LP_Pointer". Didn't manage to create one though, as LP_Pointer is "not instanciable" ,according to my intepretor.I have tryied many codes and used google several time before asking, I always fallback on this problem. I think that I might not be the only one concerned by it in the future. Any ideas?
Using python 3.6.4, 32 bits, with windows 10.
Thank's in advance for your attention !