Logo

๐Ÿงฉ 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

KeyValue
EnterKEY_enter
EscapeKEY_esc
BackspaceKEY_backspace
TabKEY_tab
SpaceKEY_space
DeleteKEY_delete
InsertKEY_insert
HomeKEY_home
EndKEY_end
Page UpKEY_pageup
Page DownKEY_pagedown
Arrow UpKEY_up
Arrow DownKEY_down
Arrow LeftKEY_left
Arrow RightKEY_right
Caps LockKEY_capslock

Modifier Keys

ModifierValue
ControlKEY_ctrl
ShiftKEY_shift
AltKEY_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_F24

Example:

("REPLACE")["help"] = "KEY_F1"

Numpad Keys

Numpad KeyValue
0โ€“9KEY_num0 โ€ฆ KEY_num9
SlashKEY_numslash
AsteriskKEY_numasterisk
MinusKEY_numminus
PlusKEY_numplus
EnterKEY_numenter
PeriodKEY_numperiod

๐Ÿ”Š Media Actions

Media actions use the MEDIA_ prefix.

Supported Media Keys

ActionValue
Volume UpMEDIA_volup
Volume DownMEDIA_voldown
MuteMEDIA_mute
Play / PauseMEDIA_playpause
Next TrackMEDIA_nexttrack
Previous TrackMEDIA_prevtrack
StopMEDIA_stop
Browser HomeMEDIA_www_home
Browser BackMEDIA_www_back
Browser SearchMEDIA_www_search
Browser StopMEDIA_www_stop
BookmarksMEDIA_www_bookmarks
Local BrowserMEDIA_local_machine_browser
CalculatorMEDIA_calculator
Consumer ConfigMEDIA_consumer_control_configuration
Email ReaderMEDIA_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.

On this page