Internet Explorer and Xbox Controller support for games




Internet Explorer Developer Channel went experimental implementation of W3C Gamepad API and you can use your controller to create games on HTML / JavaScript as for Web applications and for Windows 8:

<!DOCTYPE html>
<title>Gamepad API Sample</title>
<meta http-equiv="X-UA-Compatible" content="IE=Edge">
<script> function gameLoop() { var gamepads = navigator.getGamepads(); for (var playerIndex = 0;
playerIndex < gamepads.length; playerIndex++) { var gamepad = gamepads[playerIndex];
if (gamepad) { if (gamepad.buttons[6].pressed || gamepad.buttons[7].pressed)
// A trigger is pressed, fire weapon. fireWeapon(playerIndex);

} window.requestAnimationFrame(gameLoop); 


If you want to implement gamepad support in the game to HTML5 for Windows 8 now, not waiting for the release of the next version of Internet Explorer, you can use the wrapper over XInput for Javasctipt.


Windows 8 XInput and JavaScript controller sketch sample

Building games with controller support?

Love to hear from you..

Comments (1)
  1. roee says:

    Any idea when this API will be implemented on the main version ?

Comments are closed.

Skip to main content