From c8836c61f35e6134faafc851c2d3fac6a6db7d05 Mon Sep 17 00:00:00 2001 From: ferferga Date: Tue, 3 Mar 2020 17:56:59 +0100 Subject: [PATCH] Function rename --- src/components/input/gamepadtokey.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/components/input/gamepadtokey.js b/src/components/input/gamepadtokey.js index e430bd9891..5356bcbb45 100644 --- a/src/components/input/gamepadtokey.js +++ b/src/components/input/gamepadtokey.js @@ -372,14 +372,14 @@ require(['apphost'], function (appHost) { return false; } - function attachGamepad(e) { + function onFocusOrGamepadAttach(e) { if (isGamepadConnected() && document.hasFocus()) { console.log("Gamepad connected! Starting input loop"); startInputLoop(); } } - function dettachGamepad(e) { + function onFocusOrGamepadDetach(e) { if (!isGamepadConnected() || !document.hasFocus()) { console.log("Gamepad disconnected! No other gamepads are connected, stopping input loop"); stopInputLoop(); @@ -389,12 +389,12 @@ require(['apphost'], function (appHost) { } // Event listeners for any change in gamepads' state. - window.addEventListener("gamepaddisconnected", dettachGamepad); - window.addEventListener("gamepadconnected", attachGamepad); - window.addEventListener("blur", dettachGamepad); - window.addEventListener("focus", attachGamepad); + window.addEventListener("gamepaddisconnected", onFocusOrGamepadDetach); + window.addEventListener("gamepadconnected", onFocusOrGamepadAttach); + window.addEventListener("blur", onFocusOrGamepadDetach); + window.addEventListener("focus", onFocusOrGamepadAttach); - attachGamepad(); + onFocusOrGamepadAttach(); // The gamepadInputEmulation is a string property that exists in JavaScript UWAs and in WebViews in UWAs. // It won't exist in Win8.1 style apps or browsers.