New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

node-vigem

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-vigem

Nodejs bindings for ViGEm, a Virtual Gamepad Emulation Framework.

latest
Source
npmnpm
Version
1.0.4
Version published
Maintainers
1
Created
Source

node-vigem

Credit goes to Nefarius for his fantatstic work on ViGEm and ViGEm Bus Driver (Required)

Zero runtime checks, use together with TypeScript.

Almost a 1:1 mapping of the C++ API for ViGEm Client.

Differences:

  • No manual freeing of memory
  • Report has a nested structure
  • Exceptions instead of return codes

Check addon.d.ts for documentation.

Example

import * as vigem from "node-vigem";
// create client
let client = vigem.alloc();
// create controller
let x360 = vigem.target_x360_alloc();
// connect client to driver
vigem.connect(client);
// connect controller to client
vigem.target_add(client, x360);

let report = {
    // set dpad to South East
    dpad: { x: 1, y: -1 },
    thumbs: {
        left: { x: 0, y: 0 },
        right: { x: 0, y: 0 }
    },
    // press button A and B
    buttons: vigem.XUSB_BUTTON.A | vigem.XUSB_BUTTON.B,
    triggers: { left: 0, right: 0 },
};

// set state of the connected controller
vigem.target_x360_update(client, x360, report);

Keywords

controller

FAQs

Package last updated on 14 Jan 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts