项目作者: haoflynet

项目描述 :
Cross-platform gui macro command tool with python, automate your keyboard and mouse.
高级语言: Python
项目地址: git://github.com/haoflynet/pygui-macro.git
创建时间: 2017-11-17T15:30:30Z
项目社区:https://github.com/haoflynet/pygui-macro

开源协议:MIT License

下载


pygui-macro

Cross-platform gui macro command tool with python, automate your keyboard and mouse. You can use it to record keyboard and mouse action, and rerun it as a script.

Example

Original Gif: http://ojccjqhmb.bkt.clouddn.com/pygui-macro-example.gif

Support Events

  • on_press: keyboard press event
  • on_release: keyboard release event
  • on_move: mouse move event
  • on_click: mouse click event
  • on_scroll: mouse scroll event

Installation

Using pip, type in your command-line prompt

  1. pip install pygui-macro

Or clone the repo and inside the pygui-macro directory, type

  1. python setup.py install

Usage

Record

  1. >>> pygui-macro record -h
  2. usage: gui-macro.py record [-h] [-d DELAY] [-o ORIGINAL] [-oa] [-e END_KEY]
  3. [-ie INCLUDE_EVENTS] [-f FILE] [-c] [-ar]
  4. optional arguments:
  5. -h, --help show this help message and exit
  6. -d DELAY, --delay DELAY
  7. delay time to record (default: 3)
  8. -o ORIGINAL, --original ORIGINAL
  9. original coordinate (default: 0, 0)
  10. -oa, --original_auto set original coordinate automatically (default: False)
  11. -e END_KEY, --end_key END_KEY
  12. end record hot key (default: Esc
  13. -ie INCLUDE_EVENTS, --include_events INCLUDE_EVENTS
  14. which event be recorded (default: [])
  15. -f FILE, --file FILE macro script filename (default: script
  16. -c, --continue continuee (default: false)
  17. -ar, --auto_release whether auto release the key (default: true)

Example

  1. sudo pygui-macro record -ie on_press

Run

  1. >>> pygui-macro run -h
  2. usage: gui-macro.py run [-h] [-f FILE]
  3. optional arguments:
  4. -h, --help show this help message and exit
  5. -f FILE, --file FILE specify the macro script filename (default: script)

Example

  1. sudo pygui-macro run

Platform limitations

Linux

  • X server must be running
  • The environment variable $DISPLAY must be set. Such as DISPLAY=:0 /usr/bin/pygui-macro run

Mac OSX

sudo privileges is necessary.

Windows

TODO

  • verify script
  • if statement
  • while statement

Copyright (c) 2017 haoflynet - Released under The MIT License.