๐งฉ Usage & Scripting
Define replace rules, press keys, trigger media actions, and output text using the ZeroTrace scripting system.
๐ Overview
ZeroTrace uses a rule-based scripting system that reacts to detected input and performs actions instantly.
You do not write firmware or code. You define replace rules that map detected text to keyboard actions, media actions, or text output.
๐ Replace Rules
Rule Syntax
("REPLACE")["trigger"] = "value"-
trigger The exact text to detect in the input stream
-
value The action to execute when the trigger is detected
Example
("REPLACE")["h"] = "KEY_right"When h is detected, the Right Arrow key is pressed.
Rules trigger instantly when the trigger text appears in the input stream.
โจ๏ธ Keyboard Actions
Keyboard actions use the KEY_ prefix.
Common Keys
| Key | Value |
|---|---|
| Enter | KEY_enter |
| Escape | KEY_esc |
| Backspace | KEY_backspace |
| Tab | KEY_tab |
| Space | KEY_space |
| Delete | KEY_delete |
| Insert | KEY_insert |
| Home | KEY_home |
| End | KEY_end |
| Page Up | KEY_pageup |
| Page Down | KEY_pagedown |
| Arrow Up | KEY_up |
| Arrow Down | KEY_down |
| Arrow Left | KEY_left |
| Arrow Right | KEY_right |
| Caps Lock | KEY_capslock |
Modifier Keys
| Modifier | Value |
|---|---|
| Control | KEY_ctrl |
| Shift | KEY_shift |
| Alt | KEY_alt |
| GUI (Windows / Command) | KEY_gui |
Modifiers are pressed and released automatically.
Function Keys
Function keys are supported from F1 to F24.
KEY_F1 โฆ KEY_F24Example:
("REPLACE")["help"] = "KEY_F1"Numpad Keys
| Numpad Key | Value |
|---|---|
| 0โ9 | KEY_num0 โฆ KEY_num9 |
| Slash | KEY_numslash |
| Asterisk | KEY_numasterisk |
| Minus | KEY_numminus |
| Plus | KEY_numplus |
| Enter | KEY_numenter |
| Period | KEY_numperiod |
๐ Media Actions
Media actions use the MEDIA_ prefix.
Supported Media Keys
| Action | Value |
|---|---|
| Volume Up | MEDIA_volup |
| Volume Down | MEDIA_voldown |
| Mute | MEDIA_mute |
| Play / Pause | MEDIA_playpause |
| Next Track | MEDIA_nexttrack |
| Previous Track | MEDIA_prevtrack |
| Stop | MEDIA_stop |
| Browser Home | MEDIA_www_home |
| Browser Back | MEDIA_www_back |
| Browser Search | MEDIA_www_search |
| Browser Stop | MEDIA_www_stop |
| Bookmarks | MEDIA_www_bookmarks |
| Local Browser | MEDIA_local_machine_browser |
| Calculator | MEDIA_calculator |
| Consumer Config | MEDIA_consumer_control_configuration |
| Email Reader | MEDIA_email_reader |
Example
("REPLACE")["mute_audio"] = "MEDIA_mute"โ๏ธ Text Output
If the value does not start with KEY_ or MEDIA_, it is treated as text.
Inline Text
("REPLACE")["brb"] = "be right back"Types the text exactly as written.
Text With Newline
Prefix with !print to type text followed by Enter.
("REPLACE")["send"] = "!print Hello world"๐ค Single Characters
Single characters are supported directly.
("REPLACE")["dot"] = "."
("REPLACE")["slash"] = "/"๐ง How Matching Works
- Matching is substring-based
- Triggers are case-sensitive
- The first matching rule is executed
- Only one rule triggers per input event
- Keys are pressed and released automatically
Avoid very short triggers like "a" or "e" unless intentional.
Use unique prefixes such as zt_, /cmd, or :: for safer scripting.
๐งช Practical Examples
Vim-style Navigation
("REPLACE")["h"] = "KEY_left"
("REPLACE")["j"] = "KEY_down"
("REPLACE")["k"] = "KEY_up"
("REPLACE")["l"] = "KEY_right"Media Shortcut
("REPLACE")["pause"] = "MEDIA_playpause"Quick Message
("REPLACE")["gm"] = "!print Good morning"๐ฏ Best Practices
- Use clear and unique trigger words
- Prefer longer triggers to avoid accidental matches
- Test rules live in the Web UI
- Combine scripting with keyword and regex detection for advanced workflows
Changes apply instantly once the script is loaded. No flashing or reboot required.
๐ Summary
The ZeroTrace scripting system allows you to:
- React to live keyboard input
- Replace text dynamically
- Trigger keyboard and media events
- Build fast, flexible, and language-independent workflows
Continue with Advanced Detection to combine scripting with keyword and regex rules.