Skip to content

kevincastejon/js-gamepad-axes-as-buttons

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

js-gamepad-axes-as-buttons

Monitor axes as buttons on top of Gamepad library

Original work from https://www.npmjs.com/package/gamepad
All events and methods of the original API remain unchanged
Usage:

const GamePad = require("lepioo.gamepad");
GamePad.init();

setInterval(GamePad.processEvents,16);
setInterval(GamePad.detectDevices,500);

GamePad.on("axisDown",(id, axis, direction, timestamp)=>console.log("padId:"+id+" axis:"+axis+" direction:"+direction+" DOWN"));
GamePad.on("axisUp",(id, axis, direction, timestamp)=>console.log("padId:"+id+" axis:"+axis+" direction:"+direction+" UP"));

Github sources

About

Monitor axes as buttons on top of Gamepad library

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published