Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/danny-dasilva/py_keyboard
Python wrapper for hid device on the pi zero w
https://github.com/danny-dasilva/py_keyboard
hid keyboard raspberry-pi raspberry-pi-zero-w usb usb-hid
Last synced: 25 days ago
JSON representation
Python wrapper for hid device on the pi zero w
- Host: GitHub
- URL: https://github.com/danny-dasilva/py_keyboard
- Owner: Danny-Dasilva
- License: gpl-3.0
- Created: 2019-09-13T21:33:41.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2022-04-21T19:11:09.000Z (over 2 years ago)
- Last Synced: 2024-11-15T03:14:51.850Z (about 1 month ago)
- Topics: hid, keyboard, raspberry-pi, raspberry-pi-zero-w, usb, usb-hid
- Language: Python
- Homepage:
- Size: 123 KB
- Stars: 19
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## Python HID USB emulator
Python Wrapper for emulating a HID USB device for the raspi zero w
setup from https://randomnerdtutorials.com/raspberry-pi-zero-usb-keyboard-hid/
## git repo
`pip3 install git+https://github.com/Danny-Dasilva/Py_Keyboard.git`
## on a brand new pi zero w`git clone https://github.com/Danny-Dasilva/Py_Keyboard.git`
in Py_Keyboard folder
`source install.sh`
example.py
```python
from Py_Keyboard.HID import Keyboard
kbd = Keyboard()
kbd.press("CONTROL ALT T")
kbd.write('ls\n')
```
### Editing
All write operations are done inside the `send_report` function inside `Py_Keyboard>HID.py`bytes written can be returned from the press and write function
```python
from Py_Keyboard.HID import Keyboard
kbd = Keyboard()
bytes_press = kbd.press("CONTROL ALT T")
print(bytes_press)
bytes_write = kbd.write('ls\n')
print(bytes_write)
```### Keycodes
Keycodes are graciously borrowed from adafruitsee documentation [here](Py_Keyboard/keycodes.py)
## to do
`keycodes = layout.keycodes('$')`
Test pip package import