evanw/node-spacemouse

语言: JavaScript

git: https://github.com/evanw/node-spacemouse

JavaScript中的3dconnexion SpaceMouse的OS X驱动程序
An OS X driver for the 3dconnexion SpaceMouse in JavaScript
README.md (中文)

节点SpaceMouse等

这是JavaScript中3dconnexion SpaceMouse的OS X驱动程序。它还包含一个守护程序,它通过WebSockets代理方向数据。

图书馆用法:

var spacemouse = require('./spacemouse').listen();
spacemouse.on('connect', function() {
  console.log('connect');
});
spacemouse.on('disconnect', function() {
  console.log('disconnect');
});
spacemouse.on('update', function(data) {
  console.log('update', data.tx, data.ty, data.tz, data.rx, data.ry, data.rz);
});

守护进程用法:

$ npm install -g spacemouse
$ spacemouse
[SpaceMouse] server listening at http://localhost:8123/
[SpaceMouse] connected to device

本文使用googletrans自动翻译,仅供参考, 原文来自github.com

en_README.md

node-spacemouse

This is an OS X driver for the 3dconnexion SpaceMouse in JavaScript. It also contains a daemon that proxies orientation data over WebSockets.

Library usage:

var spacemouse = require('./spacemouse').listen();
spacemouse.on('connect', function() {
  console.log('connect');
});
spacemouse.on('disconnect', function() {
  console.log('disconnect');
});
spacemouse.on('update', function(data) {
  console.log('update', data.tx, data.ty, data.tz, data.rx, data.ry, data.rz);
});

Daemon usage:

$ npm install -g spacemouse
$ spacemouse
[SpaceMouse] server listening at http://localhost:8123/
[SpaceMouse] connected to device