a0726h77 / sixense

2 stars 2 forks source link

監聽系統 hotkey #6

Open a0726h77 opened 8 years ago

a0726h77 commented 8 years ago

試試 https://github.com/schurpf/pyhk

18z commented 8 years ago

https://github.com/schurpf/pyhk 在 pyhk.py 中 import pythoncom 似乎是 for win32 ?

另外, 試試

  1. https://gist.github.com/18z/2d15463e74d851f58812bd811683c969#file-keylistener-py #not working
  2. https://github.com/maliubiao/python_hotkeys # works
a0726h77 commented 8 years ago

pythoncom 在 pywin32 裡,所以的確是 Windows 上用的

a0726h77 commented 8 years ago

要不也可以 pyhk 與 python_hotkeys 一起用

import sys if sys.platform == "win32": ... elif sys.platform == 'cygwin': ... elif sys.platform[:5] == 'linux': ... elif sys.platform == 'darwin': ... else: ...

http://stackoverflow.com/questions/20927131/python-module-win32com-on-linux/20927174#20927174

18z commented 8 years ago

Great! 那我們就用這個方法來做。