Library for emulate mouse and keyboard on raspberry pi zero
Project description
HID python library for emulating mouse and keyboard on PI.
Setup
- Install apt dependencies
sudo apt-get update
sudo apt-get install -y git python3-full
- install usb gadget module
- Install
zero-hid
withpip
pip3 install zero-hid
Usage
Note: You should connect the data usb port (left one) to the raspberry, and NOT the power port
- Control mouse
from zero_hid import Mouse
m = Mouse()
for i in range(5):
m.move(10, 10)
- Control keyboard
from zero_hid import Keyboard
k = Keyboard()
k.type('Hello world!')
Features
- Relative / Absolute mouse movements
- Left / Right click
- Scrolling
- Typing
- Hot keys
- Easy to setup
- Comprehensive Testing
Examples
see examples
Tests
Raspberry Pi Model | Raspbian Version | Kernel Version |
---|---|---|
Raspberry Pi 4 | Raspbian 12 | 6.1 |
Raspberry Pi Zero | Raspbian 5.10 | - |
Gotaches
Error when installing with pip
error: externally-managed-environment
See how-solve-error-externally-managed-environment-when-installing-pip3
Or simply execute
sudo rm -rf /usr/lib/python3.11/EXTERNALLY-MANAGED
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
zero-hid-0.1.5.tar.gz
(30.5 kB
view hashes)
Built Distribution
zero_hid-0.1.5-py3-none-any.whl
(45.6 kB
view hashes)