Git Product home page Git Product logo

Comments (3)

jbms avatar jbms commented on April 27, 2024

I'm not aware of any way to send/receive UDP packets from web client javascript, except for WebRTC which is a particular UDP protocol. I see several options for getting events from the chair into neuroglancer:

  1. Create a server (e.g. in Python) that proxies between the chair and neuroglancer by talking to the chair over UDP and to neuroglancer over websockets (which works over TCP).
  2. If you are on Linux, create a program that talks to the chair over UDP and creates a regular linux input device via uinput into which it injects key/mouse events that are translated from whatever is sent from the chair. That way neuroglancer will get the events through the browser as regular input events and they can be handled normally. The translation might prove annoying, but maybe it could be made to work, and it might be more efficient than the websockets approach.

from neuroglancer.

markvanraai avatar markvanraai commented on April 27, 2024

Does Neuroglancer support joystick input? Because I would like to have the chair in parallel with the mouse and keyboard, as a "third hand" so to speak. So I'd need up to 4 additional (unused) axes. If I could somehow access mouse axes beyond x,y, and scrollwheel would be ideal, but I have not encountered any instance of this anywhere yet. However, e.g. the 2 analog sticks of a gamepad would work instead.
I am running Windows now (thanks for the bug fix!). But the chair is actually connected through an mbed LPC 1768 and I have an HID connector through which I can simulate joystick/gamepad output (or standard mouse, or keyboard outputs).
I think using a TCP connection over WebSockets is cleaner from an implementation point of view. But it may not be ideal for compatibility and performance, especially when used over a remote server?

from neuroglancer.

jbms avatar jbms commented on April 27, 2024

Neuroglancer doesn't itself have any joystick support, but it looks like the Web Gamepad API already supported by most browsers will do exactly what you need:
https://developer.mozilla.org/en-US/docs/Web/API/Gamepad_API/Using_the_Gamepad_API

from neuroglancer.

Related Issues (20)

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.