diff --git a/src/openfl/ui/GameInput.hx b/src/openfl/ui/GameInput.hx index 16134a1cbe..5aebfc99a6 100644 --- a/src/openfl/ui/GameInput.hx +++ b/src/openfl/ui/GameInput.hx @@ -135,7 +135,7 @@ import lime.ui.GamepadButton; if (!__devices.exists(gamepad)) { - var device = new GameInputDevice(gamepad.guid, gamepad.name); + var device = new GameInputDevice(gamepad); __deviceList.push(device); __devices.set(gamepad, device); numDevices = __deviceList.length; diff --git a/src/openfl/ui/GameInputDevice.hx b/src/openfl/ui/GameInputDevice.hx index 5e5217fc0c..03a4afc1e9 100644 --- a/src/openfl/ui/GameInputDevice.hx +++ b/src/openfl/ui/GameInputDevice.hx @@ -61,10 +61,11 @@ import lime.ui.Gamepad; } #end - @:noCompletion private function new(id:String, name:String) + @:noCompletion private function new(gamepad:Gamepad) { - this.id = id; - this.name = name; + this.__gamepad = gamepad; + this.id = gamepad.guid; + this.name = gamepad.name; var control; @@ -94,6 +95,11 @@ import lime.ui.Gamepad; return 0; } + public function getLimeGamepad():Gamepad + { + return __gamepad; + } + /** Retrieves a specific control from a device. @param i