All Projects â†’ andrew â†’ Node Xbox Controller

andrew / Node Xbox Controller

Licence: mit
🎮 [UNMAINTAINED] Interface for Xbox 360 game controller into Node.js

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Node Xbox Controller

XB1ControllerBatteryIndicator
A tray application that shows a battery indicator for an Xbox-ish controller and gives a notification when the battery level drops to (almost) empty.
Stars: ✭ 536 (+111.86%)
Mutual labels:  controller, gamepad
stick
Platform-agnostic asynchronous gamepad, joystick and flightstick library for the Rust Programming Language
Stars: ✭ 41 (-83.79%)
Mutual labels:  controller, gamepad
DualSenseWindows UE4
Unreal Engine 4 port of the Windows API for the PS5 DualSense controller created at Ohjurot/DualSense-Windows
Stars: ✭ 25 (-90.12%)
Mutual labels:  controller, gamepad
VGamepad
Server-Side Installer & Instructions
Stars: ✭ 19 (-92.49%)
Mutual labels:  controller, gamepad
Unswitch
🕹 A tiny event handler for Switch controllers!
Stars: ✭ 574 (+126.88%)
Mutual labels:  controller, gamepad
Borealis
Hardware accelerated, controller and TV oriented UI library for PC and Nintendo Switch (libnx).
Stars: ✭ 135 (-46.64%)
Mutual labels:  controller, gamepad
Segacontroller
Arduino library to read Sega Genesis (Mega Drive) and Master System (Mark III) controllers.
Stars: ✭ 55 (-78.26%)
Mutual labels:  controller, gamepad
Antimicrox
Graphical program used to map keyboard buttons and mouse controls to a gamepad. Useful for playing games with no gamepad support.
Stars: ✭ 226 (-10.67%)
Mutual labels:  controller, gamepad
Controllerextrabundle
Controller extra Bundle for Symfony2
Stars: ✭ 157 (-37.94%)
Mutual labels:  controller
Key Mapper
🎮 An easy to use tool to change the mapping of your input device buttons.
Stars: ✭ 184 (-27.27%)
Mutual labels:  gamepad
Controllerx
Create controller-based automations with ease to control your home devices and scenes.
Stars: ✭ 141 (-44.27%)
Mutual labels:  controller
Cerebral
Declarative state and side effects management for popular JavaScript frameworks
Stars: ✭ 1,946 (+669.17%)
Mutual labels:  controller
Three.vrcontroller
Support hand controllers for Oculus, Vive, Windows Mixed Reality, Daydream, GearVR, and more by adding VRController to your existing Three.js-based WebVR project.
Stars: ✭ 213 (-15.81%)
Mutual labels:  gamepad
Gardener
Kubernetes-native system managing the full lifecycle of conformant Kubernetes clusters as a service on Alicloud, AWS, Azure, GCP, OpenStack, EquinixMetal, vSphere, MetalStack, and Kubevirt with minimal TCO.
Stars: ✭ 2,093 (+727.27%)
Mutual labels:  controller
Vigem
Virtual Gamepad Emulation Framework
Stars: ✭ 225 (-11.07%)
Mutual labels:  gamepad
Gamecontroller.js
A JavaScript library that lets you handle, configure, and use gamepads and controllers on a browser, using the Gamepad API
Stars: ✭ 141 (-44.27%)
Mutual labels:  gamepad
Apisix Ingress Controller
ingress controller for K8s
Stars: ✭ 139 (-45.06%)
Mutual labels:  controller
Xqpagecontroller
PageController, including normal style, including sticky, tableview in tableview
Stars: ✭ 240 (-5.14%)
Mutual labels:  controller
Transition
Easy interactive interruptible custom ViewController transitions
Stars: ✭ 2,566 (+914.23%)
Mutual labels:  controller
Archit Ios
Intelygenz iOS Architecture
Stars: ✭ 203 (-19.76%)
Mutual labels:  controller

Node Xbox Controller

npm version Dependency Status devDependency Status Gitter

Interface for Xbox 360 game controller into Node.js

Lots of low level details about the controller here:

Mac OSX driver: for Lion/Snow Leopard or for Yosemite

Install

npm install xbox-controller

Usage

var XboxController = require('xbox-controller');
var xbox = new XboxController;

xbox.on('a:press', function (key) {
  console.log(key + ' press');
});

xbox.on('b:release', function (key) {
  console.log(key+' release');
});

xbox.on('lefttrigger', function(position){
  console.log('lefttrigger', position);
});

xbox.on('righttrigger', function(position){
  console.log('righttrigger', position);
});

xbox.on('left:move', function(position){
  console.log('left:move', position);
});

xbox.on('right:move', function(position){
  console.log('right:move', position);
});

xbox.on('connected', function(){
  console.log('Xbox controller connected');
});

xbox.on('not-found', function(){
  console.log('Xbox controller could not be found');
});

Also see the example.js for usage.

LEDs

Set LED pattern on controller:

xbox.setLed(0x0A);

Available LED patterns:

0x00   All off
0x01   All blinking
0x02   1 flashes, then on
0x03   2 flashes, then on
0x04   3 flashes, then on
0x05   4 flashes, then on
0x06   1 on
0x07   2 on
0x08   3 on
0x09   4 on
0x0A   Rotating (e.g. 1-2-4-3)
0x0B   Blinking*
0x0C   Slow blinking*
0x0D   Alternating (e.g. 1+4-2+3), then back to previous*

Rumble

Control left and right rumble motors:

var leftStrength = 255;
var rightStrength = 255;

xbox.rumble(leftStrength, rightStrength);

Where the strengths are between 0 and 255.

Within function

Listen for when a trigger or stick's position is within a particular range:

xbox.within('righttrigger', [50,100], function(err, data){
	console.log('rightttrigger within 50 and 100', err, data);
});

Multiple Devices

On startup, if a device is in use, it will be skipped and the next available device will be used. The serial number and path will be printed to the console for debugging.

Use the printed serial number to specifically address devices if required, see Serial Numbers below.

Serial Numbers

Each device has own serial number. On startup, the serial number of the device detected will be printed to the console.

To use a specific serial number, specify it when creating the controller:

var xbox = new XboxController('9BB004D0');

If you have a third party controller without 'controller' in the name, specify the device serial number to use that device.

Configuring a Third Party Controller

To configure a third party controller:

XboxController.configure();

Copyright

Copyright (c) 2016 Andrew Nesbitt. See LICENSE for details.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].