mirror of
https://github.com/dbisu/pico-ducky.git
synced 2025-12-06 02:41:45 +00:00
Updating instructions for adding keyboard layouts
This commit is contained in:
10
README.md
10
README.md
@@ -34,7 +34,7 @@ Install and have your USB Rubber Ducky working in less than 5 minutes.
|
||||
|
||||
7. Find a script [here](https://github.com/hak5darren/USB-Rubber-Ducky/wiki/Payloads) or [create your own one using Ducky Script](https://github.com/hak5darren/USB-Rubber-Ducky/wiki/Duckyscript) and save it as `payload.dd` in the Pico.
|
||||
|
||||
8. Be careful, if your device isn't in [setup mode](#setup-mode), the device will reboot and after half a second, the script will run.
|
||||
8. Be careful, if your device isn't in [setup mode](#setup-mode), the device will reboot and after half a second, the script will run.
|
||||
|
||||
### Setup mode
|
||||
|
||||
@@ -43,9 +43,13 @@ The easiest way to so is by using a jumper wire between those pins as seen bello
|
||||
|
||||

|
||||
|
||||
## Adding non-US keybaords
|
||||
|
||||
Instructions for adding non-US keyboards can be found [here](keyboard-layouts.md).
|
||||
|
||||
## Useful links and resources
|
||||
|
||||
### Docs
|
||||
### Docs
|
||||
|
||||
[CircuitPython](https://circuitpython.readthedocs.io/en/6.3.x/README.html)
|
||||
|
||||
@@ -59,4 +63,4 @@ The easiest way to so is by using a jumper wire between those pins as seen bello
|
||||
|
||||
[USB Rubber Ducky playlist by **Hak5**](https://www.youtube.com/playlist?list=PLW5y1tjAOzI0YaJslcjcI4zKI366tMBYk)
|
||||
|
||||
[CircuitPython tutorial on the Raspberry Pi Pico by **DroneBot Workshop**](https://www.youtube.com/watch?v=07vG-_CcDG0)
|
||||
[CircuitPython tutorial on the Raspberry Pi Pico by **DroneBot Workshop**](https://www.youtube.com/watch?v=07vG-_CcDG0)
|
||||
|
||||
@@ -1,8 +1,16 @@
|
||||
import usb_hid
|
||||
from adafruit_hid.keyboard import Keyboard
|
||||
from adafruit_hid.keyboard_layout_win_de_de import KeyboardLayout
|
||||
from adafruit_hid.keyboard_layout_win_de_de import KeyboardLayoutWinDeDe
|
||||
from adafruit_hid.keycode import Keycode
|
||||
kblayout = "DE"
|
||||
|
||||
if kblayout == "DE":
|
||||
from keyboard_layout_win_de import KeyboardLayout
|
||||
from keycode_win_de import Keycode
|
||||
elif kblayout == "BR":
|
||||
from keyboard_layout_win_br import KeyboardLayout
|
||||
from keycode_win_br import Keycode
|
||||
else:
|
||||
from adafruit_hid.keyboard_layout_us import KeyboardLayoutUS as KeyboardLayout
|
||||
from adafruit_hid.keycode import Keycode
|
||||
import time
|
||||
import digitalio
|
||||
from board import *
|
||||
@@ -60,7 +68,7 @@ def parseLine(line):
|
||||
runScriptLine(newScriptLine)
|
||||
|
||||
kbd = Keyboard(usb_hid.devices)
|
||||
layout = KeyboardLayoutWinDeDe(kbd)
|
||||
layout = KeyboardLayout(kbd)
|
||||
|
||||
# sleep at the start to allow the device to be recognized by the host computer
|
||||
time.sleep(.5)
|
||||
|
||||
26
keyboard-layouts.md
Normal file
26
keyboard-layouts.md
Normal file
@@ -0,0 +1,26 @@
|
||||
## How to install non-US keyboard layouts
|
||||
|
||||
Clone Circuitpython_Keyboard_Layouts
|
||||
`git clone https://github.com/Neradoc/Circuitpython_Keyboard_Layouts`
|
||||
|
||||
`cd Circuitpython_Keyboard_Layouts`
|
||||
|
||||
Install dependencies
|
||||
`pip3 install -r requirements-modules.txt`
|
||||
|
||||
Install build dependencies
|
||||
`pip3 install -r requirements-dev.txt`
|
||||
|
||||
Build layouts
|
||||
`python3 build.py`
|
||||
|
||||
Copy libraries to pico
|
||||
`cp _build/circuitpython-keyboard-layouts-6.x-mpy-<date>/lib/*.mpy /<Pico mount point>/lib`
|
||||
|
||||
Update duckyinpython.py
|
||||
Change
|
||||
`kblayout="US"`
|
||||
to
|
||||
`kblayout="<keyboard layout>"`
|
||||
|
||||
Update `if kblayout ==` block to include the new keyboard layout if not already included
|
||||
Reference in New Issue
Block a user