API Reference
adafruit_ducky
CircuitPython library for running DuckyScript
Author(s): Eva Herrada
Implementation Notes
Software and Dependencies:
Adafruit CircuitPython firmware for the supported boards: https://github.com/adafruit/circuitpython/releases
- class adafruit_ducky.Ducky(filename: str, keyboard: Keyboard, layout: KeyboardLayoutBase)
Class that runs a DuckyScript file.
Quickstart: Importing and using the library
Here is an example of using the
Duckyclass. First you will need to import the librariesimport time import usb_hid from adafruit_hid.keyboard import Keyboard from adafruit_hid.keyboard_layout_us import KeyboardLayoutUS import ducky
Once this is done, define the keyboard layout and initialize the
Duckyclass.time.sleep(1) # Sleep for a bit to avoid a race condition on some systems keyboard = Keyboard(usb_hid.devices) keyboard_layout = KeyboardLayoutUS(keyboard) # We're in the US :) duck = ducky.Ducky('duckyscript.txt', keyboard, keyboard_layout)
Now, set up a loop which will run a line of the script every time
loopis called.result = True while result is not False: result = duck.loop()