i am trying to send some virtual keycodes to an application while it is out of focus. I get it to work without a problem except for releasing normal keys.
I have tried:
win32api.SendMessage(hwnd, win32con.WM_KEYUP, VK_CODE["a"])
win32api.PostMessage(hwnd, win32con.WM_KEYUP, VK_CODE["a"])
releasing a key works perfectly with the left mouse button:
win32api.SendMessage(hwnd, win32con.WM_LBUTTONUP, win32con.MK_LBUTTON, 0)
and using keydb_event:
win32api.keybd_event(VK_CODE[i],0 ,win32con.KEYEVENTF_KEYUP ,0)
But for some reason when trying to release a key using SendMessage it pressed down the button instead.