Coder Social home page Coder Social logo

joy2's Introduction

Presentation

Electron application for dispatch local Joystick data to WebSocket client

Should work on any environnement suppporting Electron.

Tested on Windows 7.

The joystick USB should be configured as gamepad, et seeing by Chrome/Chormium (HTML 5). (HID/Xinput device): Browser Test (FF/Chrome/Webkit) can be done with : http://html5gamepad.com/

Websocket distribution offer jouystick acces for any application which do not support HID ou XInput.

Message is JSON.stringify of [axes,buttons,nomess,time_ms], with :

  • axes : array of values of 7 axes, values are 0..200, 0 is 100
  • buttons : buttons states of 12 buttons, values are 0 or 1
  • nomessage : incremented for each message
  • time_ms : timestamp of event (new Date().getTime() % 1000)

Example:

 [[100,100,100,100,100,100,100],[1,0,0,0,0,0,0,0,0,0,0,0],739,265]

Usage

> npm install
> npm start
or
> .\node_modules\.bin\electron.exe .

> firefox client_test.html

Press the button '1' on the joystick to activate the server ... (this is a html5 gamepad chrome requirement)

Files

  • main.js : startup Electron : load index.html
  • index.html : main page, virual pad in SVG, include joy.js
  • joy.js : gamepad client, virtual and real, websocket server for js ditribution.
  • client_test.html : can be invoked by a navigator for client websocket test.
  • config.html : Webgl tester , quadcopter simulator :) can be use directly by a navigator, or in electron app by (button 4)+(Zoom max).

modules used:

  • ws for websocket server,
  • many many module for Electron GUI : Chromium under Node.js.

License

MIT

Use three.js for apropos.

joy2's People

Contributors

glurp avatar

Watchers

James Cloos avatar

Forkers

meister1593

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.