During the development of the compiler I realized that some of the definitions could be discarded, leaving room for future improvements in Duckyscript and at the same time added some extensions.
The improvements are:
- The token for DEFAULT DELAY was changed to 0xDF
- The token for DELAY was changed to 0xDE
the modifications above make easier to track the commands while inspecting the binary file (they are mnemonic just in case you haven't noticed)
- The specific tokens for CONTROL, ALT, SHIFT, GUI (0xA8..0XAB) have been dismissed. Instead the HOLD token (0xAF) is used preceeding the code of the combination key desired.
The HOLD token allows a combination of several keys like CONTROL + ALT + T to invoke a terminal on linux systems.
- The STRING token has been dismissed. Instead the HID keycode of each character is directly stored.
The upper case letters as well as some symbols are preceded by HOLD token plus LSHIFT token in order to produce the desired character, for instance @ is generated by issuing HOLD + LSHIFT + KEY_2 (0xAF, 0xE0, 0x1F)
- The RELEASE token (0xAE) was created as a safeguard to release all keys that eventually have been held by a command.
I suspect that further improvements on the compiler might render this command useless.
- The BEGIN (0xA5) and AGAIN (0xA6) tokens have been created. The objective of such commands is to allow the repetition of blocks of commands.
The latter two commands are only defined by now and both are yet to be implemented.
The new Token specification can be seen in the table below: