I'm trying to control my ASUS ROG Flare keyboard LED colors using python. I downloaded the Aura Software Developer Kit from the ASUS website. link here: https://www.asus.com/campaign/aura/us/SDK.php inside the kit there is a menu guide and a dll file called AURA_SDK.dll. The guide says that with the mentioned dll the keyboard can be controlled.
I'm using the ctypes python package and succeeded in loading the package, but when I'm calling the first function to obtain control on the keyboard the program fails because I don't fully understand the argument the function needs to run.
Code I am trying:
import ctypes
path_dll = 'AURA_SDK.dll'
dll = ctypes.cdll.LoadLibrary(path_dll)
res = dll.CreateClaymoreKeyboard() # fails here
Any ideas on how to create this argument?
Thanks in advance.

This should do it. A good habit to get into is always define
.argtypesand.restypefor the functions you call. This will make sure parameters are converted correctly between Python and C types, and provide better error checking to help catch doing something incorrectly.There are also many pre-defined Windows types in
wintypesso you don't have to guess what ctype-type to use for a parameter.Also note that
WINAPIis defined as__stdcallcalling convention and should useWinDLLinstead ofCDLLfor loading the DLL. On 64-bit systems there is no difference between standard C calling convention (__cdecl) and __stdcall, but it will matter if you are using 32-bit Python or desire portability to 32-bit Python.