模拟键盘,鼠标事件的Python包。A Python package simulating keyboard and mouse events Author:七分诚意 qq:3076711200 邮箱:3416445406@qq.com
Project description
模拟键盘,鼠标事件的Python包。 A Python package simulating keyboard and mouse events模块名称: event - 切勿使用import userevent !
新增功能: 增加了示例:鼠标控制器(examplesmouseController.py) 所包含模块 Included modules: ============================
key.py - 模拟键盘事件
包含的函数 Functions:
keydown(keycode_or_keyname):
模拟键按下。 keycode_or_keyname:按键名称或该按键的键码值
keypress(keycode_or_keyname, delay=0.05):
模拟按键。 keycode_or_keyname:按键名称或该按键的键码值 delay:键按下与释放之间的的间隔时间,间隔时间越小,按键速度越快。
keyup(keycode_or_keyname):
模拟键释放。 keycode_or_keyname:按键名称或该按键的键码值
mouse.py - 模拟鼠标事件
包含的函数 Functions:
click():
模拟鼠标左键单击
dblclick(delay=0.25):
模拟鼠标左键双击
get_screensize():
获取当前屏幕分辨率。
getpos():
获取当前鼠标位置。 返回值为一个元组,以(x,y)形式表示。
move(x, y):
模拟移动鼠标。 与goto不同,move()*产生*一个鼠标事件。
right_click():
模拟鼠标右键单击。
示例代码1: .. code-block:: python
#模拟按键Alt+F4关闭当前窗口 from event.key import * keydown(“Alt”) keydown(“f4”) keyup(“f4”) keyup(“alt”)
示例代码2: .. code-block:: python
#使用Aero Peek预览桌面。(Win7及以上系统) from event import mouse x,y=mouse.get_screensize() mouse.move(x,y) #将鼠标移至屏幕右下角 mouse.click() #模拟鼠标点击
作者 Author: 七分诚意 qq:3076711200 邮箱:3416445406@qq.com
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file event-simulate-1.0.2.tar.gz
.
File metadata
- Download URL: event-simulate-1.0.2.tar.gz
- Upload date:
- Size: 5.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.25.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.7.2rc1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f983b0a12bb2e44eb4f10a33663b003b5d75206ea13d473e7aea989445b83510 |
|
MD5 | 3f43ec19ba68849e608cc35b1f51b4b8 |
|
BLAKE2b-256 | d2568cd64d3cee1fa303882a8368d4568606ad753a8e2b578cffc5d5e07ffc33 |