Skip to main content

Library for emulate mouse and keyboard on raspberry pi zero

Project description

HID python library for emulating mouse and keyboard on PI zero.

Setup - Tested on Raspbian lite 5.10

  1. Install apt dependencies
sudo apt-get update
sudo apt-get install -y git python3-pip
  1. install usb gadget module https://github.com/Pant3x/rpizero-hid/tree/main/usb_gadget
  2. Install rpizero-hid with pip
pip3 install rpizero-hid

Usage

Note: You should connect the data usb port (left one) to the raspberry, and NOT the power port

  • Control mouse
from rpizero_hid import Mouse
m = Mouse()
for i in range(5):
    m.move_relative(10, 10)
  • Control keyboard
from rpizero_hid import Keyboard

k = Keyboard()
k.type('Hello world!')

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

rpizero-hid-0.0.1.tar.gz (16.9 kB view hashes)

Uploaded Source

Supported by

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