python 模拟键盘鼠标输入

最近需要模拟键盘鼠标的输入,一番查找之后,得到的一些结果


************************************************************************************************************************

pyUserInput,可以模拟键盘鼠标,功能很全,用起来很方便

https://github.com/SavinaRoja/PyUserInput/wiki/Installation


需要同时安装pyhook


这是其中pyMouse的一个例子

from pymouse import PyMouse m = PyMouse() m.position() #gets mouse current position coordinates m.move(x,y) m.click(x,y) #the third argument "1" represents the mouse button m.press(x,y) #mouse button press m.release(x,y) #mouse button release

************************************************************************************************************************

http://www.eventghost.org/

eventGhost


************************************************************************************************************************

http://msdn.microsoft.com/zh-cn/library/system.windows.forms.sendkeys.aspx
SendKeys

http://msdn.microsoft.com/en-us/library/ms171548.aspx?cs-save-lang=1&cs-lang=cpp#code-snippet-2


python 也有自己的SendKeys模块
https://github.com/search?l=Python&q=sendkey&ref=searchresults&type=Repositories


************************************************************************************************************************


http://stackoverflow.com/questions/11906925/python-simulate-keydown

各种模拟key的方法

http://stackoverflow.com/questions/14489013/simulate-python-keypresses-for-controlling-a-game
http://www.gamedev.net/topic/371104-c-directinput-hooking-component-and-sample/
提到了direct input








你可能感兴趣的:(python 模拟键盘鼠标输入)