Coder Social home page Coder Social logo

istador / node-ojds-nx-vigemclient Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 11 KB

Virtual controller via ViGEmClient, fetching inputs from OJDS-NX running on a Switch

License: Mozilla Public License 2.0

JavaScript 100.00%
controller nintendo-switch client

node-ojds-nx-vigemclient's Introduction

OJDS-NX ViGEm Client

This project aims to create a virtual controller on Windows that mimics the inputs from a modded Nintendo Switch.

E.g. to display the controller inputs using https://gamepadviewer.com/.

Setup

On the Switch

First the Switch needs to be modded and using the Atmosphère custom firmware.

Once that is done we can copy over the OJDS-NX files to the SD card (download the latest zip from the releases).

Once put onto the SD card, the OJDS-NX server runs automatically in the background on port 56709/tcp and waits for clients to connect. When a client connects and requests data, the server responds with the current controller values.

On your Windows PC

First we need to install the latest ViGEmBus drivers on the Windows PC (download the latest exe from the releases).

In order to run this project Node.js also needs to be installed.

Clone this repository and install additional dependencies with:

git  clone  https://github.com/Istador/node-ojds-nx-vigemclient
cd  node-ojds-nx-vigemclient
npm  install

Usage

Client

To connect to the Switch we need to know its IP address in our network. The IP address can be found at the connection status in the internet system settings on the Switch. For example let's assume it is 192.168.0.2.

Knowing its IP we can simply run:

node  client  192.168.0.2

This will connect to the Switch and create a virtual controller. It will then continues to request the controller states every about 50ms from the Switch and update the controller values until it is stopped (CTRL + C).

By default the client creates a virtual DualShock4 (PS4) controller (DirectInput). But it can also create a virtual XBox 360 controller (XInput), by adding xbox as an additional parameter. This will also remap the ABXY button layout which differs between Switch and Xbox controllers (ABXY <=> BAYX).

node  client  192.168.0.2  xbox

Test Server

To test the client without a Switch, there's also a small dummy server that responds with random controller values.

It can be started with:

node  server

And the client can connect to it by simply running:

node  client
# or:
node  client  127.0.0.1

node-ojds-nx-vigemclient's People

Contributors

istador avatar

Stargazers

 avatar  avatar

Watchers

 avatar

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.