I have tried many library like pynput, pyautogui, pydirectinput, pywinauto, ctypes using the code that provided by Strive Sun in this link Is it possible to use win32 in python 3.8 for pressing keys on your keyboard to automate keys in some games.
The only one that worked is using macro from mouse Oscar X7. I tried to reverse engineering it using IDA, when i'm searching the function that the mouse use including CallNextHookEx and SendInput.
So i'm wondering is there any way to automate Key and Mouse using hook and sendinputs, by referring this link CallNextHookEx and this SendInput but these link using C++. Is there any way to do it using python only ?