Skip to content

About

Low-latency, secure remote keyboard and mouse relay for Windows with encrypted pairing, native GUIs, and FRP-friendly connectivity.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

WinInputRelay

简体中文

WinInputRelay is an open-source, low-latency keyboard and mouse relay for Windows 11. It sends physical input from a controller computer to a receiver computer over an authenticated, encrypted TCP session and injects it through the Windows SendInput API.

It is designed to complement screen-sharing and remote-display tools when the display path works well but their input path is unavailable, unsuitable, or needs to remain independent.

Download and Quick Start

Download the latest Windows executables:

  1. Start the receiver on the controlled computer.
  2. If you use FRP, keep 127.0.0.1:38081 and forward the public TCP port to it. For a direct LAN connection, select a reachable local listen address and allow the port through Windows Firewall.
  3. Click Start listening, then Copy key to copy the temporary 64-character pairing key.
  4. Start the controller and enter the receiver's public or LAN address, port, and temporary key.
  5. Click Connect. The controller initially remains in Local input unlocked mode.
  6. Press Ctrl+Alt+F12 to start forwarding input. Press it again to restore local input.

For an emergency stop, press Pause three times within 1.5 seconds. This releases remote input, disconnects, and exits the controller.

Components

  • win_input_controller: captures keyboard and mouse input on the controlling computer.
  • win_input_receiver: authenticates the controller and injects input on the controlled computer.

Both applications provide native Windows GUIs built with Clay layout, a Win32/GDI renderer, and native Win32 controls.

Features

  • Low-latency keyboard and relative mouse forwarding.
  • Keyboard scan-code injection.
  • Five mouse buttons plus vertical and horizontal wheel support.
  • One controller per receiver session.
  • A fresh random 256-bit temporary pairing key on every receiver launch.
  • Mutual HMAC-SHA-256 authentication with random nonces.
  • AES-256-GCM encrypted and authenticated input records.
  • Independent directional session keys and strict replay protection.
  • Automatic heartbeat, disconnect detection, and remote key/button release.
  • A click-through virtual cursor on the receiver for remote-display tools that do not capture the injected system cursor.
  • Ctrl+Alt+F12 to enable or disable remote input capture.
  • Triple-press Pause within 1.5 seconds for an unconditional local emergency stop.

Requirements

  • Windows 11
  • Visual Studio 2022 with Desktop development with C++
  • CMake 3.24 or newer
  • GitHub access during the first configuration so CMake can fetch the pinned Clay revision

Build

Configure and build a Debug version:

cmake --preset vs2022
cmake --build --preset debug

The Debug executables are generated at:

build/vs2022/controller/Debug/win_input_controller.exe
build/vs2022/receiver/Debug/win_input_receiver.exe

Build distributable Release executables:

cmake --build --preset release

The build automatically copies the standalone executables to:

release/win_input_controller.exe
release/win_input_receiver.exe

The release/ directory is ignored by Git.

Publishing a GitHub Release triggers the Windows release workflow. After a successful build and test run, both executables are attached to that Release automatically.

Safety Controls

  • Ctrl+Alt+F12: toggles remote capture locally and is never forwarded.
  • Triple-press Pause within 1.5 seconds: releases remote input, disconnects, and exits the controller. Pause is never forwarded.
  • A connection loss, heartbeat timeout, queue overflow, or network failure removes the hooks and restores local input.
  • The receiver tracks pressed keys and mouse buttons and releases them when the session ends.

Temporary Pairing

The receiver generates a new 32-byte random pairing key every time it starts. The key is displayed only for the current process lifetime and is not saved to disk.

Restarting the receiver invalidates its current key. Use the newly displayed key for the next connection. Do not commit keys, include them in screenshots, or share them in issue reports.

FRP Example

On the receiver computer, configure frpc to forward a public TCP port to:

127.0.0.1:38081

Enter the public frps address and mapped port in the controller. Application-layer authentication and encryption cover the complete controller-to-receiver session and do not depend on FRP transport encryption.

Security Model

  • Each receiver launch generates a new random 256-bit PSK.
  • Both peers contribute a random 32-byte nonce to every connection.
  • HMAC-SHA-256 proves possession of the PSK without transmitting it.
  • Input and heartbeat records use AES-256-GCM.
  • Each direction uses a separately derived key and nonce prefix.
  • Strictly increasing 64-bit record sequence numbers reject replay and reordering.
  • The receiver listens on loopback by default.

This design protects application data and access to the receiver. It cannot protect a computer that is already compromised by malware, nor can it replace operating-system endpoint security.

Windows Limitations

  • A non-elevated receiver cannot inject input into a process running at a higher integrity level.
  • Running the receiver as administrator permits input into ordinary elevated applications, but not the UAC secure desktop.
  • Ctrl+Alt+Delete, the Windows sign-in screen, and other secure desktops cannot be controlled through ordinary SendInput.
  • Some games and anti-cheat systems ignore or block SendInput.
  • Some capture tools may intentionally exclude layered overlay windows, including the virtual cursor.

Contributing and Feature Requests

Contributions and ideas are welcome. Before proposing a large change, please open a feature request describing the use case, expected behavior, and any relevant Windows or networking constraints.

Please do not include pairing keys, private addresses, credentials, or other secrets in issues, logs, screenshots, or pull requests.

License

WinInputRelay is licensed under the GNU General Public License v3.0 only. If you distribute this program or a modified version, the GPLv3 requires you to provide the corresponding source code under the same license. See the license text for the complete terms.

Roadmap

  • Optional headless operation.
  • System tray controls.
  • More input-state and abnormal-network tests.

About

Low-latency, secure remote keyboard and mouse relay for Windows with encrypted pairing, native GUIs, and FRP-friendly connectivity.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages