diff --git a/README.md b/README.md index 8d082fe..e976f77 100644 --- a/README.md +++ b/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 ![Setup mode with a jumper](images/setup-mode.png) +## 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) \ No newline at end of file +[CircuitPython tutorial on the Raspberry Pi Pico by **DroneBot Workshop**](https://www.youtube.com/watch?v=07vG-_CcDG0) diff --git a/duckyinpython.py b/duckyinpython.py index a3f85b0..e07039d 100644 --- a/duckyinpython.py +++ b/duckyinpython.py @@ -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) diff --git a/keyboard-layouts.md b/keyboard-layouts.md new file mode 100644 index 0000000..3b2c0db --- /dev/null +++ b/keyboard-layouts.md @@ -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-/lib/*.mpy //lib` + +Update duckyinpython.py +Change +`kblayout="US"` +to +`kblayout=""` + +Update `if kblayout ==` block to include the new keyboard layout if not already included