Skip to content

[FEATURE REQUEST] Ability to record and replay HID macros (Keyboard+mouse) #153

Open

Description

@pekishev

Background

NanoKVM-Pro can already send keyboard and mouse events from the web UI, but there is no way to save and replay a sequence. For BIOS setup, Windows Win+R flows, login screens, or any repeatable HID sequence, users currently have to click through the virtual keyboard every time.

Proposed Change

Add HID macros to the Keyboard menu: named scripts that replay keyboard and mouse actions through the existing HID channel.

Suggested behavior:

  • Create / edit / delete named macros from the web UI
  • Persist them on the device so they survive reboot
  • Play a macro with one click
  • Use a small DuckyScript-like language (easy to read, easy to share)

Example script

DELAY 300
GUI r
DELAY 400
STRING notepad
ENTER
DELAY 500
STRING Hello from NanoKVM
ENTER
CLICK 50 50

Supported commands could include:

  • STRING / STRINGLN — type text
  • ENTER, TAB, ESC, BACKSPACE, DELETE, function keys
  • CTRL c, ALT F4, GUI r, CTRL-ALT DELETE — key combinations
  • DELAY 500 — pause in milliseconds
  • CLICK 50 30 / DBLCLICK 20 20 RIGHT — click at percent of the remote screen
  • RUN Name — call another macro (one nesting level)

Expected Behavior

  • Macros appear in Keyboard → Macros
  • Playing a macro sends HID events to the host (keyboard + absolute mouse)
  • Invalid scripts are rejected before save, with a line number
  • Live mouse input is ignored while a macro is playing

Use Case

  • Enter BIOS/UEFI and apply the same key sequence on every boot
  • Open a Windows Run dialog and launch a tool
  • Type a fixed command on a Linux console that has no GUI
  • One-click “click this button on the remote screen” without hunting for coordinates each time

Benefits

  • Saves time on repetitive KVM tasks
  • No extra hardware (Rubber Ducky / extra USB gadget) for many common flows
  • Scripts are plain text and can be copied between devices

Implementation note

A working prototype is already in my fork, if that helps review:

Macros are stored in /etc/kvm/macros.json. Playback uses the existing HID keyboard/mouse APIs from the web client.

Activity

  1. changed the title [-][FEATURE REQUEST] BadUSB-style HID macros in the keyboard menu[/-] [+][FEATURE REQUEST] Ability to record and replay HID macros (Keyboard+mouse)[/+] on Sep 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions