Ducky script implementation

Hi,
I’ve noticed there is a lot of different implementations of ducky script.
Seems that old rubber ducky is actually most restrictive and newer devices using the script can do more things
eg:
max 2 buttons at the same time
ctrl+N
vs
up to 5 buttons at the same time
ctrl+command+f

Are there any plans for future development to enable extra features?
Or if you aren’t planning on adding them are there strong preferences for keeping official firmware on official ducky script or would you be happy to merge upgrades if someone makes them and they make sense.

1 Like

I’m doing some extra research in case this is something I can implement.
Seems like ducky encoders explicitly define multi-key combos via:

const dsSyntaxMap = {
(...)

'CTRL-ALT': handleDSModifier,
'CTRL-SHIFT': handleDSModifier,
'ALT-SHIFT': handleDSModifier,
'COMMAND': handleDSModifier,
'COMMAND-CTRL': handleDSModifier,
'COMMAND-CTRL-SHIFT': handleDSModifier,
'COMMAND-OPTION': handleDSModifier,
'COMMAND-OPTION-SHIFT': handleDSModifier
};

In our case we do that via:

static const DuckyKey ducky_keys[] = {
    {"CTRL-ALT", KEY_MOD_LEFT_CTRL | KEY_MOD_LEFT_ALT},
    {"CTRL-SHIFT", KEY_MOD_LEFT_CTRL | KEY_MOD_LEFT_SHIFT},
    {"ALT-SHIFT", KEY_MOD_LEFT_ALT | KEY_MOD_LEFT_SHIFT},
    {"ALT-GUI", KEY_MOD_LEFT_ALT | KEY_MOD_LEFT_GUI},

(...)
};

Our list is simply shorter.
git ref

So on the surface is seems that we can at least easily allow extra options by replicating options they have with correct references. I have to read up more about it to see if this is as simple as adding extra options and rest of code can handle it.

I’ve also noticed that we are missing COMMAND I’m assuming this is fully handed over to GUI but it may be worth adding it anyway in case someone would like to have it explicit (eg. swapped CTRL and COMMAND)

1 Like