开发者

Mouse side buttons in python?

I am trying to use my mouse as remote on my laptop and I would like to use side buttons in them. I am coding in python as I have开发者_开发百科 already succeeded doing it with autohotkey. But autohotkey uses too much resources. The mouse is Razer Orochi.. It has 7 buttons and a scrollwheel. I would like to use left side front key for modifier and lbutton, rbutton, mbutton and wheel as secondary... also by pressing both left side buttons I would like to lock the mouse until 4 buttons, all of them on sides are pressed... Yet I can't seem to figure out how to read input from side buttons on mouse in python.


This isn't quite an answer, but maybe a set of references to start you out. I don't have experience with Python on Windows, but it looks like these might be helpful:

  • there's a set of Windows Extensions for Python: pywin32.
  • Yak created a two-finger scrolling driver by reading the COM in a special way in Python here.

Judging by how Yak got two-finger scrolling in his code, I imagine what you're doing is not so far off? I also think win32com would help you out.


Final solution was made using PyHook
Many thanks to Peter Parente.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜