0

I have read this doc

But in win32con module,there is no key called WM_XBUTTONUP.And I also find a doc.

And finally I found win32con.VK_XBUTTON1 existed,But I didn't found WM_XBUTTONUP.I also found VK_UP so I tried to use it to replace WM_XBUTTONUP.

Now all my code is:

import win32api,win32con

win32api.mouse_event(win32con.VK_XBUTTON1|win32con.VK_UP,0,0,0,0)

But when I run it,My mouse button will don't work. What should I do?

jizhihaoSAMA
  • 12,336
  • 9
  • 27
  • 49
  • Have you tried use defined value 0x020C ([WM_XBUTTONUP](https://learn.microsoft.com/en-us/windows/win32/inputdev/wm-xbuttonup))? – Rita Han Apr 06 '20 at 01:57
  • I haven't,But now If I use `mouse_event`,My python will be not responding. – jizhihaoSAMA Apr 06 '20 at 02:50
  • `mouse_event` function has been superseded. Use [`SendInput`](https://learn.microsoft.com/windows/desktop/api/winuser/nf-winuser-sendinput) instead. – Rita Han Apr 06 '20 at 05:33
  • Sorry,It seems that `win32api` has no attribute `SendInput` and `Sendinput` and `sendInput`. – jizhihaoSAMA Apr 06 '20 at 12:09
  • Check [this thread](https://stackoverflow.com/questions/11906925/python-simulate-keydown) to see if it helps. – Rita Han Apr 07 '20 at 01:23

0 Answers0