Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import flash.ui.GameInput;
- var gameInput:GameInput = new GameInput();
- this.addEventListener(Event.ENTER_FRAME,update);
- function update(e:Event):void
- {
- if(GameInput.numDevices > 0)
- {
- var gpad = GameInput.getDeviceAt(0); gpad.enabled = true;
- trace("Device: " + gpad.name);
- for(var i = 0; i < gpad.numControls; i++)
- {
- var cont = gpad.getControlAt(i);
- trace(cont.id+" | "+cont.minValue+" | "+cont.maxValue);
- }
- this.removeEventListener(Event.ENTER_FRAME,update);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment