Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/murilopolese/gorat
Send OSC messages and convert it in mouse and keyboard events
https://github.com/murilopolese/gorat
Last synced: about 18 hours ago
JSON representation
Send OSC messages and convert it in mouse and keyboard events
- Host: GitHub
- URL: https://github.com/murilopolese/gorat
- Owner: murilopolese
- Created: 2013-03-06T21:23:07.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2016-01-22T09:42:38.000Z (almost 9 years ago)
- Last Synced: 2024-04-11T12:55:10.091Z (7 months ago)
- Language: HTML
- Size: 1000 KB
- Stars: 0
- Watchers: 5
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# goRat!
Expose keyboard and mouse control via websocket.
## On Server
```js
var app = require( 'express' )();
var http = require( 'http' ).Server( app );
var io = require( 'socket.io' )( http );
var robot = require( 'robotjs' );
io.on('connection', function( socket ){
socket.on( 'mousemove', function( posX, posY ) {
robot.moveMouseSmooth( posX, posY );
});
});
http.listen( 3000, function(){
console.log('listening on *:3000');
});
```## On Client
```html
var socket = io();
socket.emit( 'mousemove', 100, 100 );```
## Example
Run `npm install` and `node app.js` on the root path of this repository and open the brower on `http://localhost:3000`.