Skip to content

A GUI tool that generates Arduino HID scripts from mnemonics.

License

Notifications You must be signed in to change notification settings

wirebits/ArduinoHID-Scripter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 

Repository files navigation

ArduinoHID-Scripter

A GUI tool that generates Arduino HID scripts from mnemonics.

Key Features

  • Simple and clean GUI.
  • Two large windows one for mnemonics and other for arduino code.
  • Convert Button - Convert mnemonics to arduino script.
  • Copy Button - Copy arduino script to the clipboard so that it can paste anywhere.
  • Reset Button - Clear all data from both windows.
  • Save Button - Save arduino scripts on the system for future use.
  • Exit Button - Close the application.

New Features Added!

  • for Loop added.
  • Next line function added.
  • TYPE and TYNL supports ".
  • TYPE and TYNL supports \.
  • Multiple statements are supported inside for loop.
  • WRITE function added.

Supported Arduino Boards

The following boards are working on a microcontroller named ATMEGA32U4.

  • 32 means it has 32 Kb memory, U means it has built-in USB Communication and 4 means 4 Kb of memory consumed by bootleader.
  • It has a built-in USB Communication so that it can act as Keyboard, Mouse, Game Controller etc.
  • List of supported boards :
  1. Arduino Leonardo
  2. Arduion Micro
  3. Arduino Pro Micro

Credits

The mnemoics used in this tool is heavily inspired by Hak5 Ducky Script.

Demo Video

Demo.mp4

Setup

  1. Make sure the latest python and pip3 is installed on your system (Windows/Linux/MacOS).
  2. Download Arduino IDE from here according to your Operating System.
  3. Install it.
  4. Done! All required libraries are pre-installed in Arduino IDE.

Mnemonic Table

Mnemonics Description Example
TYPE It add text want to type in the code and put the cursor on the same line. TYPE Hello World!
TYNL It add text want to type in the code and put the cursor on the next line. TYNL ArduinoHID Scripter
WAIT It add time in the code. WAIT 1000
PRESS It press and hold the key(s) and then release all key(s). PRESS GUI R
REDO It add loop in the code. REDO 6 TYPE Hello World!
WRITE It add ASCII characters in the code. WRITE *

Details of Mnemonics

1. TYPE

  • It add text want to type in the code and put the cursor on the same line.
  • NEW - It supports " " in the TYPE.
  • Example - TYPE Hello World!

2. TYNL

  • It add text want to type in the code and put the cursor on the next line.
  • NEW - It supports " " in the TYNL.
  • Example - TYNL Hello World!

3. WAIT

  • It add time in the code.
  • It gives time to execute between two commands.
  • Time is in milliseconds.
  • 1000 ms = 1 second.
  • Example - WAIT 1000

4. PRESS

  • It press and hold the key(s) and then release all key(s).
  • The supported mnemonics given below works with PRESS.
  • Example -
  1. PRESS GUI R
  2. PRESS CTRL SHIFT N
  3. PRESS CTRL SHIFT ENTER

5. REDO

  • It add loop in the code.
  • The loop used in this is for loop.
  • It takes two values : Number of repeatation and Statement inside the loop.
  • Example - REDO 6 TYPE Hello World!
  • Here, 6 is number of repetations and TYPE Hello World! is the statement.
  • NEW - It supports multi statements.
  • Multi statement are separated by comma ,.
  • Example - REDO 9 TYPE Hello World!, WAIT 1000, TYPE This is a test for script!
  • Here, TYPE Hello World!, WAIT 1000 and TYPE This is a test for script! are three statements and they are separated by commas.
  • REDO only supports TYPE, TYNL and WAIT Only.

6. WRITE

  • It add ASCII characters in the code.
  • It supports some ASCII characters not all and supported ASCII characters are defined in the code.
  • It press and release the key immediately.
  • Example - WRITE @

Supported Mnemonics

Alphabet Keys

A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

Function Keys

F1 F2 F3 F4 F5 F6 F7 F8 F9 F10 F11 F12

Navigation Keys

LEFT UP RIGHT DOWN TAB HOME END PGUP PGDN

Lock Keys

CAPS NUM SCROLL

System and GUI Keys

GUI ESC PRTSCR PAUSE

Editing Keys

INSERT DEL BKSP ENTER

Modifier Keys

CTRL SHIFT ALT

ASCII Characters

` ! @ # $ % ^ & * ( ) - = [ ] \ ; ' , . / SPACE ~ _ + { } | : " < > ? 0 1 2 3 4 5 6 7 8 9

Examples

Example - 1 : Mnemonic for Open Notepad and Type

WAIT 1000
PRESS GUI R
WAIT 1000
TYPE notepad
WAIT 1000
PRESS ENTER
WAIT 1000
TYPE This is a test for arduino script developed by ArduinoHID Scripter!

after click on Convert button, the arduino script of the following mnemonic is :

#include<Keyboard.h>
void setup()
{
 Keyboard.begin();
 delay(1000);
 Keyboard.press(KEY_LEFT_GUI);
 Keyboard.press('r');
 Keyboard.releaseAll();
 delay(1000);
 Keyboard.print("notepad");
 delay(1000);
 Keyboard.press(KEY_RETURN);
 Keyboard.releaseAll();
 delay(1000);
 Keyboard.print("This is a test for arduino script developed by ArduinoHID Scripter!");
 Keyboard.end();
}
void loop()
{
 //Nothing to do here ;)
}

Just copy this code and paste it in the Arduino IDE.

Example - 2 : Mnemonic for Open Notepad and Type 6 times

WAIT 1000
PRESS GUI R
WAIT 1000
TYPE notepad
WAIT 1000
PRESS ENTER
WAIT 1000
REDO 6 TYNL This is a test for arduino script developed by ArduinoHID Scripter!

after click on Convert button, the arduino script of the following mnemonic is :

#include<Keyboard.h>
void setup()
{
 Keyboard.begin();
 delay(1000);
 Keyboard.press(KEY_LEFT_GUI);
 Keyboard.press('r');
 Keyboard.releaseAll();
 delay(1000);
 Keyboard.print("notepad");
 delay(1000);
 Keyboard.press(KEY_RETURN);
 Keyboard.releaseAll();
 delay(1000);
 for (int i=1; i<=6; i++)
 {
  Keyboard.println("This is a test for arduino script developed by ArduinoHID Scripter!");
 }
 Keyboard.end();
}
void loop()
{
 //Nothing to do here ;)
}

Just copy this code and paste it in the Arduino IDE.

Tested Systems

The tool is currently tested on :

  • Windows (10)

Before coding...

Start your code with WAIT so that board get time to initiate.

Install and Run

  1. Download or Clone the Repository.
  2. Open the folder and just double click on ArduinoHIDScripter.py file.
  3. Type the mnemonics in the left window.
  4. Click on Convert button to get corresponding arduino script.
  5. Click on Copy button to copy the arduino script to the clipboard.
  6. Paste the code in the Arduino IDE.
  7. Connect your board to the PC/Laptop.
  8. Compile the code.
  9. Select the board from the Tools.
  10. Select the port number of that board.
  11. Upload the code.
    -Be Careful! As it is uploaded the script start executing.

Start/Stop the Arduino Board

Arduino Leonardo and Arduino Mico has a reset button on it.
Just press and hold the button to stop execution and release to start execution.
For Arduino Pro Micro :

  1. If want to stop Arduino Pro Micro from execution, then connect the Male-To-Male jumper wires as shown in image below :

Untitled Sketch 2_bb

  1. If want to start again the execution, simply remove the jumper wires.

About

A GUI tool that generates Arduino HID scripts from mnemonics.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages