Skip to content

lucca-ruhland/py-keyboard-mouse

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

py-keyboard-mouse

Mouse emulation via keyboard implemented in pure python.

Quick Start Guide

Requirements

Tkinter must be installed on your system.

  • for Debian based systems use apt install python3-tk
  • for Arch based systems use pacman -S tk

Installation

  • git clone https://github.com/lucca-ruhland/py-keyboard-mouse
  • cd py-keyboard-mouse
  • pip install .

How to run mouse emulation

  • keyboard-mouse [--flags]

flags

flag description
-h, --help show help message
-c, --config set path to config file with ini or yaml style
--left set key for moving cursor left
--right set key for moving curosor right
--up set key for moving cursor up
--down set key for moving cursor down
--toggle set key to toggle between normal (writing) mode and mouse emulation
--increment set mouse sensitivity (cursor movement in pixel per key stroke)

default hotkeys

  • use CTRL + M to toggle between mouse and normal mode
  • use h to go left
  • use l to go right
  • use h to go up
  • use k to go down
  • use right CTRL for left click

config file

.ini or .yaml style can be used for configuration files. An example is given here. View https://github.com/bw2/ConfigArgParse for more information on how to create config files.

Known Issues

  • keyboard-mouse needs root permissions
  • It may be necessary to run xhost + before starting keyboard-mouse

Usage in code

from keyboard_mouse import create_emulator


# for default keybindings

default_emulator = create_emulator()
default_emulator.start_emulation()

# =============================================
# for custom keybindings

custom_config = {'TOGGLE_MODE': 'ctrl+alt+m',
                'LEFT': 'a',
                'RIGHT': 'd',
                'UP':'w',
                'DOWN':'k',
                'CLICK': 'left ctrl'}     

custom_emulator = create_emulator(custom_config)
custom_emulator.start_emulation()

About

Keyboard mouse emulation implemented in pure python

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages