Doing so is often desirable for games or other interactive web pages that need to know the state of a gamepad now vs. We can do much more with the Gamepad object, including holding a reference to it and querying it to find out which buttons and axes are being pressed at any one time. We can use this in order to determine which gamepad (i.e., its ID) had caused the event, since multiple gamepads might be connected at once. As you can see, the gamepad events discussed above include a gamepad property on the event object, which returns a Gamepad object.
0 Comments
Leave a Reply. |