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-pip python3-venv
-
install usb gadget module
-
Create virtual environment
python3 -m venv ~/venv
source ~/venv/bin/activate
- Install
zero-hid
withpip
pip3 install zero-hid
- Reboot if not already!
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 / Middle click
- Scrolling
- Typing
- Hot keys
- Drag and Drop
- LEDs status
- Easy to setup
- Comprehensive Testing
Examples
see examples
Tests
Raspberry Pi Model | Raspbian Version | Kernel Version | Date of Testing |
---|---|---|---|
Raspberry Pi 4 | Raspbian 12 (bookworm) | 6.6.31 | 04/08/2024 |
Raspberry Pi 4 | Raspbian 12 | 6.1 | 01/01/2023 |
Raspberry Pi Zero | Raspbian 5.10 | - | 01/01/2023 |
Gotachas
Absolute mouse used only for positining. use relative mouse for clicking etc. see examples.
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-1.0.1.tar.gz
(21.3 kB
view details)
Built Distribution
zero_hid-1.0.1-py3-none-any.whl
(36.6 kB
view details)
File details
Details for the file zero_hid-1.0.1.tar.gz
.
File metadata
- Download URL: zero_hid-1.0.1.tar.gz
- Upload date:
- Size: 21.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0387c4f2246846cc3b11034b093c68a2d9a7adf49b1ea275b25055ea80b0b218 |
|
MD5 | 8f85e3d207c8cfd1e29b9596036580d1 |
|
BLAKE2b-256 | 8a10ec78ce642355937c3e7fb298ff4a1fff2d357a86c65d2828fbeb48bc03fe |
File details
Details for the file zero_hid-1.0.1-py3-none-any.whl
.
File metadata
- Download URL: zero_hid-1.0.1-py3-none-any.whl
- Upload date:
- Size: 36.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 16fd7b8f0e49b4af4c76711dfcc1589797481ccdcd51f8299fb2532ffdd443e7 |
|
MD5 | 7d3f262b75b502012bffbca7c6764c1d |
|
BLAKE2b-256 | 8e9c6697d63f8a4f4a10a485f2f4f870dd8c53db2332915a1ce0338ab5375b8f |