Skip to content
DavidPerezA12Public

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Repository files navigation

InputSync

Tests License: MIT

InputSync lets you share the keyboard and mouse from one computer with other computers on the same local network.

Run the server on the machine with the keyboard and mouse. Then run a client on each machine you want to control. Input events are sent over TCP and encrypted with a shared token.

This is meant to stay small and easy to follow. It is not trying to replace Synergy, Barrier, or a full KVM setup. It does not auto-discover machines, switch screens when the pointer reaches an edge, or save profiles. The goal is a simple tool that is easy to install, read, and change.

Requirements

  • Python 3.9 or newer.
  • Two or more computers on the same network.
  • System permissions to read and control the keyboard and mouse.

On macOS, you will usually need to give Accessibility permissions to Terminal, Python, or the app in System Settings.

Installation

Clone the repository and enter the folder:

git clone https://github.com/DavidPerezA12/InputSync.git
cd InputSync

Linux/macOS:

chmod +x install.sh
./install.sh

Windows:

install.bat

Manual setup:

python3 -m venv env
source env/bin/activate
python -m pip install -r requirements.txt

On Windows:

python -m venv env
env\Scripts\activate
python -m pip install -r requirements.txt

For development, install the project with its developer tools:

python -m pip install -e ".[dev]"

Usage

On the computer that shares the keyboard and mouse:

INPUTSYNC_TOKEN="change-this-token" python servidor.py

By default the server listens on all network interfaces so other computers on your LAN can connect. If you want to bind it to a specific interface, pass --host:

INPUTSYNC_TOKEN="change-this-token" python servidor.py --host 192.168.1.50

On a client computer:

INPUTSYNC_TOKEN="change-this-token" python cliente.py --ip 192.168.1.50 --port 12345

Replace 192.168.1.50 with the server IP address. The token must be the same on both sides.

You can also pass the token with --token, but using an environment variable is better because command-line arguments may be visible in the system process list:

python servidor.py --token "change-this-token"
python cliente.py --ip 192.168.1.50 --port 12345 --token "change-this-token"

The default port is 12345. To use another one:

INPUTSYNC_TOKEN="change-this-token" python servidor.py --port 23456
INPUTSYNC_TOKEN="change-this-token" python cliente.py --ip 192.168.1.50 --port 23456

If you want the client to keep trying when the server restarts or the connection drops:

INPUTSYNC_TOKEN="change-this-token" python cliente.py --ip 192.168.1.50 --reconnect

GUI

If you prefer a small window instead of the terminal:

python app_gui.py

The GUI can start either the server or the client with the IP, port, and token you enter. Logs are written in the project folder with names like servidor_inputsync.log and cliente_inputsync.log. You can also stop the processes started from the GUI.

Security

InputSync encrypts messages with a key derived from the shared token using PBKDF2-HMAC-SHA256. Use a long, unique, randomly generated token. For example:

python -c "import secrets; print(secrets.token_urlsafe(32))"

The default server bind address accepts connections from every local network interface. Only use InputSync on networks you trust, and do not expose its port to the Internet. It is not built to replace a hardened remote-access tool.

Common issues

  • ModuleNotFoundError: install the dependencies with python -m pip install -r requirements.txt.
  • The client connects but nothing moves: check Accessibility or input-control permissions.
  • Address already in use: the port is already taken. Stop the previous process or use another port.
  • It does not connect: check the server IP, firewall, and that both computers are on the same network.
  • macOS does not capture the keyboard or mouse: reopen the terminal after granting permissions.

Development

Run the tests:

python -m unittest discover -s tests

Check style and common errors:

python -m ruff check .
python -m compileall -q app_gui.py cliente.py servidor.py inputsync_protocol.py tests

Check installed dependencies:

python -m pip check

Build and install locally:

python -m pip install -e .
inputsync-server --help
inputsync-client --help
inputsync-gui

License

MIT. See LICENSE.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages