This project allows you to control your server's mouse via a mobile device using DeviceMotion
and touch events through a web interface. It's designed to run on a local server, utilizing socket.io
to transmit commands for moving and clicking the mouse on the host machine.
Important
Star Us, You will receive all release notifications from GitHub without any delay ~ ⭐️
- Touch and Motion Control: Control the mouse using touch gestures or device movement.
- Left and Right Clicks: Easily simulate mouse clicks through the web interface.
- Dynamic QR Code: A QR code is generated to easily connect your mobile device to the server.
Watch the demo of this project to see it in action.
Important
🎯 Prerequisites:
- Node.js installed (^14)
openssl
for generating SSL certificates (required for DeviceMotion API). If you do not have OpenSSL, you can use other tools to generate the necessary ssl files.xdotool
This project usesxdotool
to simulate mouse events, which is only supported on Linux systems. For other operating systems, modifications will be necessary.
-
Clone the repository and navigate into the project folder.
git clone https://github.com/cesarleaz/WebMotionMouse.git cd WebMotionMouse
-
Install dependencies:
npm install
-
Generate SSL certificates to enable
DeviceMotion
API (required for mobile motion tracking):openssl req -nodes -new -x509 -keyout key.pem -out cert.pem -days 365
-
Start the server:
node server.js
-
A QR code will be generated in the terminal. Scan the QR code with your mobile device to access the web interface.
- Open your mobile browser and scan the QR code or manually on terminal.
Note
- The server runs on any available port (automatically assigned).
- Make sure your device is connected to the same local network as the server.
Warning
- DeviceMotion API requires SSL: For motion controls to work, make sure you're serving the app via HTTPS.
- Tested only on Linux systems: This project uses
xdotool
to simulate mouse events, which is only supported on Linux systems. For other operating systems, modifications will be necessary.
openssl req -nodes -new -x509 -keyout key.pem -out cert.pem -days 365
- Add Mouse Scrolling: Implement a feature to allow scrolling through the web interface.
- Click & Drag: Add support for click-and-drag operations on the mousepad.
Feel free to improve this project by opening issues or submitting pull requests. Your contributions are welcome!
- Report bugs: Open an issue to help us track any bugs or potential improvements.
- Suggest features: Do you have ideas on how to improve the app? Let us know!
- Submit Pull Requests: Contribute to the project by submitting your code to help enhance its functionality.
This project is open source under the MIT License.