Skip to main content

模拟键盘,鼠标事件的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 !

所包含模块 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

event-simulate--1.0.1.tar.gz (4.1 kB view details)

Uploaded Source

File details

Details for the file event-simulate--1.0.1.tar.gz.

File metadata

  • Download URL: event-simulate--1.0.1.tar.gz
  • Upload date:
  • Size: 4.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.7.2rc1

File hashes

Hashes for event-simulate--1.0.1.tar.gz
Algorithm Hash digest
SHA256 c62b151325bd83542847995955d1c4eeeafbb95616de8f909a3f4d625af321d4
MD5 a47cf8b635882f7aa0d422fab6d287bd
BLAKE2b-256 1479a93e9fb352c3b2c8825214a13043ed7a7fd9a4141169b3f0e64ba199fafb

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page