Skip to contentSkip to Content
Commands libraryOverview

Mantis Commands Library

Mantis Language · Command Library · Karvi Labs

Every Mantis script (.mantis) is constructed from short, uppercase commands that instruct the Mantis USB hardware to emulate keyboard strokes, manage execution timing, control onboard LEDs, or branch logic based on button inputs.

Below is the complete reference library for every command supported by the Mantis Device Compiler (MDC) in Karvi Studio. Click on any command to view its dedicated syntax guide, runtime parameters, runnable payload examples, and common mistakes.


Text Injection Commands

CommandSyntaxPrimary Use
STRINGSTRING textTypes text exactly as written at the current typing pace.
STRINGLNSTRINGLN textTypes text and immediately sends an ENTER keystroke.
FAST_STRINGFAST_STRING textInjects text via batched USB HID reports at maximum machine speed.

Timing & Pacing Commands

CommandSyntaxPrimary Use
DELAYDELAY msPauses payload execution for a specified duration in milliseconds.
SET_DELAYSET_DELAY msConfigures fixed millisecond pacing between consecutive keystrokes.
SET_SPEEDSET_SPEED speedSets typing speed presets ($Human, $Normal, $Fastest, $Random).

Key Modifiers & Navigation

CommandSyntaxPrimary Use
GUIGUI [key]Presses Windows / Command key or triggers shortcuts like GUI r.
CTRLCTRL [key]Emulates the Control key or shortcut chords like CTRL c.
ALTALT [key]Emulates the Alt / Option key or chords like ALT F4.
SHIFTSHIFT [key]Emulates Shift modifier or text selection combinations.
ENTERENTERSends a Return / Enter key press to submit dialogs or run commands.
INJECT_MODINJECT_MOD modifierInjects low-level raw modifier combinations directly over HID.

Logic, Variables & Modular Code

CommandSyntaxPrimary Use
DEFINEDEFINE name type valueDeclares compile-time constants for strings and integers.
LOOPLOOP [count] ... END_LOOPRepeats blocks of keystrokes with support for BREAK and CONTINUE.
IF / ELSEIF cond THEN ... END_IFConditional branching based on button states (BUTTON_PRESSED).
FUNCTIONFUNCTION name() ... END_FUNCTIONDeclares reusable subroutines with up to 8 levels of call recursion.
REMREM commentAdds comments that are stripped during compilation.

Hardware & System Controls

CommandSyntaxPrimary Use
LED_ON / LED_OFFLED_ON / LED_OFFToggles the physical onboard status LED for execution feedback.
WAIT_FOR_BUTTON_PRESSWAIT_FOR_BUTTON_PRESSHalts payload execution until the physical onboard button is pressed.
BUTTON_DEFBUTTON_DEF ... END_BUTTONDefines an asynchronous event handler for button clicks.
ATTACKMODEATTACKMODE modeConfigures USB endpoint profiles (HID keyboard, CDC serial, OFF).

Next Steps

Last updated on