Skip to content

Commit

Permalink
Update documentation!
Browse files Browse the repository at this point in the history
  • Loading branch information
vaneenige committed Aug 7, 2018
1 parent 59c7e9d commit 742b767
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,28 +32,28 @@ window.addEventListener("gamepaddisconnected", ({ gamepad }) => {});
// Import the library
import Unswitch from 'unswitch';

// Create the listener
// Observe a controller
const unswitch = new Unswitch({
side: 'L', // or R
b: (pressed) => {},
a: (pressed) => {},
y: (pressed) => {},
x: (pressed) => {},
l: (pressed) => {},
r: (pressed) => {},
minus: (pressed) => {},
plus: (pressed) => {},
lstick: (pressed) => {},
rstick: (pressed) => {},
home: (pressed) => {},
screenshot: (pressed) => {},
side: (pressed) => {}, // The 'Side' button near ZL or ZR
z: (pressed) => {}, // ZL or ZR
axes: (position) => {},
b: p => {},
a: p => {},
y: p => {},
x: p => {},
sl: p => {},
sr: p => {},
minus: p => {},
plus: p => {},
lstick: p => {},
rstick: p => {},
home: p => {},
screenshot: p => {},
bumper: p => {}, // L or R
trigger: p => {}, // ZL or ZR
axes: p => {},
});

function render() {
// Check for button stateupdates
// Call the update function manually
unswitch.update();
requestAnimationFrame(render);
}
Expand Down

0 comments on commit 742b767

Please sign in to comment.