Skip to content

Instantly share code, notes, and snippets.

/*
Ok, so let's say you've got a situation where one browser fires
two events and the other browser only fires one.
How about a specific example: IE does not fire the "change" event on
a text input when you press the enter key, whereas other browsers do.
Well, what if you want to execute some code both when an
input changes OR when a user presses enter? You don't want
@zachstronaut
zachstronaut / example.js
Last active November 27, 2017 14:55
Support for 1 - 4 Gamepad Controllers in Impact.js for Local Multiplayer Games
// bind keyboard and gamepad buttons
ig.input.bind( ig.KEY.X, 'shoot1');
ig.input.bind( ig.GAMEPAD1.FACE_1, 'shoot1');
ig.input.bind( ig.GAMEPAD2.FACE_1, 'shoot2');
ig.input.bind( ig.GAMEPAD3.FACE_1, 'shoot3');
ig.input.bind( ig.GAMEPAD4.FACE_1, 'shoot4');