Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does window.navigator.getGamepads() in Dart work?

Tags:

dart

Calling window.navigator.getGamepads() returns a valid list of Gamepad objects, but the axes and buttons properties are always null.

The index and ID properties are all valid though. Am I missing something or does it just not work yet?

http://api.dartlang.org/docs/bleeding_edge/dart_html/Gamepad.html

like image 201
Zeiban Avatar asked Nov 05 '13 03:11

Zeiban


1 Answers

The Gamepad API works in dart, just not in the dartium browser (see Issue 15119). If you need to use the API, either create a new browser launch, or right-click your html file and then click on 'Run as JavaScript'. Either of these solutions will launch in your standard browser.

like image 199
timedt Avatar answered Sep 17 '22 21:09

timedt