To build the list of known GameInput controls spreadsheet, I had to build a small sandbox-like application test for controls reported by connected devices. It was my intention to make this available to other people so they could do their own tests, so here it is: just wait for the following Flash movie to load (reload the page if it gets stuck), click on it, then use whatever connected game devices you have to test for input controls, their values, and their injected Keyboard events (if any). The values you see should be the same for both the web version of Flash Player, and Adobe AIR.
It’s a simple application, but it does its job: the first column will list the connected devices, their available controls (buttons and axis), and the state of each of those (including whether granular values were detected for analog buttons and axis). The middle column will show the state of pressed keyboard keys; this is useful when testing on Android and the OUYA. Finally, the third column will display a log of everything that has been pressed, in the sequence it happened; this helps detecting injected keys, especially on mobile versions of AIR.
The embedded version above is provided just as a demo; you can open it in a full page/tab here. An Android/OUYA AIR equivalent can be found here in the form of an APK that needs to be installed to your device (same with the OUYA). Also noticed that the source for the tester interface is available on GitHub; it is part of the KeyActionBinder library. It doesn’t really use the library, though, since it’s more of a debugging and development tool.
I’ve try your gameinput testing interface, it works smoothly! Even for unofficial gamepad (mine has a brand called ‘murago’, it’s twin gamepad).
Anyway, I try to run your library in github, but unfortunately my Flash Builder said “VerifyError: Error #1014: Class flash.ui::GameInput could not be found.” I’ve overlay the AIR 4.0 if that concern. Do you have some experience stumbled upon it?
You’re using the right version of AIR, but it’s likely that you’re either not using the correct playerglobals.swc or not exporting to the right SWF version – meaning you’re targetting a version of Flash that didn’t have GameInput yet. It’s a similar problem to this:
In a nutshell: on your compilation settings, make sure to select the correct playerglobal.swc from AIR 4.0 (if applicable) or, more importantly, select the target version for Flash Player using the “–target-player” switch (11.8+) and/or a compatible “–swf-version” (21+).
Right now, for that one specific project, I’m using “12.0” for the “–target-player” switch, but old versions should work. Your mileage may vary.
Oh my God! It’s true! I add this line in Additional compiler arguments:
-locale en_US –target-player=12.0 -swf-version=21
And it works! Thank’s a lot!
Great Zeh, I was looking for something to test an xbox controller on a chromebook in flash and it works 🙂 thanks
Comments are closed.