# How to get an Xbox controller working in HTML5?

**URL:** <https://forums.unrealengine.com/t/how-to-get-an-xbox-controller-working-in-html5/291699>\
**Category:** Platform & Builds\
**Tags:** gamepad, HTML5, xbox-controller, unreal-engine, question\
**Created:** [August 22, 2014, 1:11pm UTC](https://forums.unrealengine.com/t/how-to-get-an-xbox-controller-working-in-html5/291699 "2014-08-22T13:11:31Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mosel3y](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Mosel3y](https://forums.unrealengine.com/u/Mosel3y)\
**Post date:** [August 22, 2014, 1:11pm UTC](https://forums.unrealengine.com/t/how-to-get-an-xbox-controller-working-in-html5/291699/1 "2014-08-22T13:11:31Z")

</div>

I have a game that I’ve packaged for HTML5, it’s working OK, but I can’t control it with an Xbox controller. It works in PIE obviously.

Does anyone know what I have to do to get a gamepad working in a HTML5 game?

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_27b005a2](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_27b005a2](https://forums.unrealengine.com/u/anonymous_user_27b005a2)\
**Post date:** [August 27, 2014, 10:18pm UTC](https://forums.unrealengine.com/t/how-to-get-an-xbox-controller-working-in-html5/291699/2 "2014-08-27T22:18:55Z")

</div>

Gamepad APIs are exposed by emscripten but not yet have been implemented for engine. I will add this request as a official TTP. Meanwhile you can have look at html5.h in emscripten sdk. [html5.h — Emscripten 3.1.39-git (dev) documentation](http://kripken.github.io/emscripten-site/docs/api_reference/html5.h.html?highlight=gamepad#gamepad) .

---

<div class="post-metadata">

**Author:** ![Mosel3y](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Mosel3y](https://forums.unrealengine.com/u/Mosel3y)\
**Post date:** [August 28, 2014, 3:59pm UTC](https://forums.unrealengine.com/t/how-to-get-an-xbox-controller-working-in-html5/291699/3 "2014-08-28T15:59:02Z")

</div>

Ah, thanks for the answer Ankitkk. Hopefully it is implemented at some point.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_cacd3de0](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_cacd3de0](https://forums.unrealengine.com/u/anonymous_user_cacd3de0)\
**Post date:** [February 25, 2015, 12:58am UTC](https://forums.unrealengine.com/t/how-to-get-an-xbox-controller-working-in-html5/291699/4 "2015-02-25T00:58:10Z")

</div>

I have 4.7 release and I can’t get GamePad working. Is it suppose to work?

---

<div class="post-metadata">

**Author:** ![Shadowriver](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Shadowriver](https://forums.unrealengine.com/u/Shadowriver)\
**Post date:** [February 25, 2015, 5:09am UTC](https://forums.unrealengine.com/t/how-to-get-an-xbox-controller-working-in-html5/291699/5 "2015-02-25T05:09:39Z")

</div>

Thing is with html5 it is limited to what browser can do and Html5 gamepad support seems to be experimental

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_27b005a2](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_27b005a2](https://forums.unrealengine.com/u/anonymous_user_27b005a2)\
**Post date:** [February 25, 2015, 4:50pm UTC](https://forums.unrealengine.com/t/how-to-get-an-xbox-controller-working-in-html5/291699/6 "2015-02-25T16:50:22Z")

</div>

Gamepad code is there and should be working - what issues are you facing?

---

<div class="post-metadata">

**Author:** ![Sephern](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Sephern](https://forums.unrealengine.com/u/Sephern)\
**Post date:** [March 30, 2016, 7:48am UTC](https://forums.unrealengine.com/t/how-to-get-an-xbox-controller-working-in-html5/291699/7 "2016-03-30T07:48:06Z")

</div>

I know this is an old thread and it’s been deemed answered, but I have been working in 4.9, and via Launch I haven’t been able to get my game to pop up in Chrome or 64-bit Firefox, but in 32-bit Firefox I was able to get it up without a gamepad plugged in. When my gamepad is plugged in I receive an error in the image below.

 ![84356-capture.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/f/8/a/f8a20afd8d6732dd472ca5c437de87227e56e5b3.jpeg)

After I select OK, I receive the text:  
FSlateApplication::OnControllerButtonReleased?5()  
undefined?T()  
FHTML5InputInterface::SendControllerEvents()  
FHTML5Application::PollGameDeviceState(float)  
FSlateApplication::PollGameDeviceState()  
FEngineLoop::Tick()  
HTML5\_Tick()  
dynCall\_v

I’m about to test this in 4.10, but I thought I’d add this for some info since the OP did not and it’s been a while and I’m getting an error.

Edit: It does appear to have the exact same problem in 4.10 with the error in the same file on a different line.

 ![84371-capture.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/a/7/0a778259c77da9298ef0b992eb993dfaa092ee61.jpeg)
