Skip to content

This module wrapper keyboard and mouse events and send to system to have same behavior with physical keyboard and mouse.

License

Notifications You must be signed in to change notification settings

peitaosu/Keyboard-Mouse-Simulation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Keyboard & Mouse Simulation

GitHub license

This module wrapper keyboard and mouse events and send to system to have same behavior with physical keyboard and mouse.

You can use it in your automation scripts, or as easy-to-use API when you want to send keyboard and mouse events to different desktop environment (Windows & X11 & macOS) in same way.

Setup

Xlib and virtkey are the libraries used to send mouse_event and keyboard_event on Linux with X11. So you need to install python-xlib and python-virtkey following the command below here, before use the scripts:

sudo apt-get install python-xlib python-virtkey

Quartz is the library which will be used on macOS. You can use following command to install this python module:

pip install pyobjc-framework-Quartz

Use

Import the package file into your script, call the functions.

# Example

import kbsim.keyboard_simulation as kb_sim
import mssim.keyboard_simulation as ms_sim

def run():
    kb_sim.TypeKey("a")
    # use shortcut, only TypeKey() supported
    kb_sim.TypeKey("ctrl+alt+t")
    ms_sim.Click(200, 200, 1)

About

This module wrapper keyboard and mouse events and send to system to have same behavior with physical keyboard and mouse.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages