简体   繁体   中英

How can I make a macro recorder/player with pyHook in Python?

I want to make a little script that, when pressed some specific key, for example F2, the macro starts to record the mouse actions, only the location of the click, and then play it when pressed another specific key...

Could someone give me a little example of what I have to do?

this isn't the code you need, and isn't with pyhook, but its code that you could use, and pyhook could be integrated

http://kvance.livejournal.com/985732.html

Here is an example using pyHook to respond to global hotkeys. pyHook only works on windows but you didn't specify the OS.

http://fadedbluesky.com/2011/using-pyhook-to-block-windows-key/

I've put up some code of a similiar task I tried;
pyHook stops receiving Key press events (randomly)?

Unfortuneately, there's a problem with pyHook macros that the question highlights.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM