Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

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`.