Module Overview
The HID Gadget module transforms a rooted Android device into a professional USB Human Interface Device. It enables the phone to function as a fully featured keyboard, mouse, and media remote for any connected computer using a lightweight, terminal-based interface.
I’ve been keeping this on my daily driver to troubleshoot headless servers and control my media center straight from Termux. Under the hood, it hooks directly into your kernel's ConfigFS to emulate physical hardware, letting you fire off DuckyScript payloads or drag-and-drop windows without needing to install buggy desktop client software.
- Terminal GUI controller: A visual
hid-tuiinterface provides a full virtual keyboard and a velocity-sensitive radar analog stick for precise mouse movement. - Script your inputs instantly using the built-in CLI wrappers, making it incredibly easy to automate repetitive text typing or complex keyboard shortcuts.
- DuckyScript 3.0 compatibility is baked right in, allowing you to execute sophisticated injection payloads directly from your phone.
- Auto-recovers automatically if the HID driver fails or crashes, operating without any external libraries thanks to a statically linked build.
Support & Requirements
- Android Version: Any Android version (Requires a kernel with ConfigFS HID support)
- Root Type: Magisk or KernelSU
How to Install
- Download the latest
hid-gadget-module.zipfile to your phone's internal storage. - Open Magisk or KernelSU, navigate to the Modules tab, and tap Install from Storage.
- Select the zip file, wait for the flashing process to complete, and reboot your device.
🎮 Quick Usage Guide
Once installed, everything runs directly through a root terminal like Termux or an ADB shell. Here is how I get things moving in everyday use:
Firing up the Interface
To launch the main graphical controller, just drop this into your terminal:
su -c hid-tui
- Drag and drop windows easily by tapping the
[HL],[HM], or[HR]hold toggles to lock a click down. - Adjusting your cursor speed happens on the fly using the
SENSbutton built into the layout. - Velocity-sensitive movement kicks in based on how far you drag from the center of the "Radar Zone"
[+].
Manual Initialization
Sometimes the gadget driver doesn't catch immediately on boot depending on how your kernel handles USB configurations. If the host computer isn't reacting, force the setup script manually:
su -c hid-setup
Scripting via CLI
You can trigger hardware inputs straight from bash scripts without opening the TUI at all. I use these convenience wrappers to fire off quick text injections or system shortcuts:
# Type text directly
hid-keyboard "Hello World"
# Send a system combo
hid-keyboard CTRL-ALT-DEL
# Flick the cursor (X, Y)
hid-mouse move 100 -50
# Bump the media volume
hid-consumer VOL+
Rate this Module
Share your experience with the community.
* You will be prompted to login via Google in one click to verify your rating.