From a617ec8afec43949849163167daaf51a60d2b298 Mon Sep 17 00:00:00 2001 From: MDN Date: Sun, 13 Feb 2022 00:57:20 +0000 Subject: [CRON] sync translated content --- .../window/gamepaddisconnected_event/index.html | 52 ++++++++++++++++++ .../web/api/window/ongamepadconnected/index.html | 64 ---------------------- .../api/window/ongamepaddisconnected/index.html | 51 ----------------- 3 files changed, 52 insertions(+), 115 deletions(-) create mode 100644 files/zh-cn/web/api/window/gamepaddisconnected_event/index.html delete mode 100644 files/zh-cn/web/api/window/ongamepadconnected/index.html delete mode 100644 files/zh-cn/web/api/window/ongamepaddisconnected/index.html (limited to 'files/zh-cn/web/api/window') diff --git a/files/zh-cn/web/api/window/gamepaddisconnected_event/index.html b/files/zh-cn/web/api/window/gamepaddisconnected_event/index.html new file mode 100644 index 0000000000..48ef7f7e79 --- /dev/null +++ b/files/zh-cn/web/api/window/gamepaddisconnected_event/index.html @@ -0,0 +1,52 @@ +--- +title: Window.ongamepaddisconnected +slug: Web/API/Window/gamepaddisconnected_event +translation_of: Web/API/Window/ongamepaddisconnected +original_slug: Web/API/Window/ongamepaddisconnected +--- +
{{DefaultAPISidebar("Gamepad API")}}{{SeeCompatTable}}
+ +

The ongamepaddisconnected property of the {{domxref("Window")}} interface represents an event handler that will run when a gamepad is disconnected (when the {{event('gamepaddisconnected')}} event fires).

+ +

The event object is of type {{domxref("GamepadEvent")}}.

+ +

解析

+ +
window.ongamepaddisconnected = function() { ... };
+
+ +

示例

+ +
window.ongamepaddisconnected = function() {
+  // A gamepad has been disconnected
+};
+ +

Specifications

+ + + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName('Gamepad ', '#event-gamepaddisconnected', 'gamepaddisconnected event')}}{{Spec2('Gamepad')}}Initial definition
+ +

Browser compatibility

+ + + +

{{Compat("api.Window.ongamepaddisconnected")}}

+ +

See also

+ + diff --git a/files/zh-cn/web/api/window/ongamepadconnected/index.html b/files/zh-cn/web/api/window/ongamepadconnected/index.html deleted file mode 100644 index 809fd1f1c7..0000000000 --- a/files/zh-cn/web/api/window/ongamepadconnected/index.html +++ /dev/null @@ -1,64 +0,0 @@ ---- -title: Window.ongamepadconnected -slug: Web/API/Window/ongamepadconnected -tags: - - API - - Event Handler - - Experimental - - Gamepad API - - Property - - Reference - - Window - - gamepadconnected - - ongamepadconnected - - 手柄 - - 游戏 -translation_of: Web/API/Window/ongamepadconnected ---- -
{{DefaultAPISidebar("Gamepad API")}}{{SeeCompatTable}}
- -

{{domxref("Window")}} 接口的 ongamepadconnected 属性是一个事件处理程序,它将在游戏手柄连接时运行 (即当 {{event('gamepadconnected')}} 事件触发时)。

- -

此方法响应的对象类型是 {{domxref("GamepadEvent")}}.

- -

语法

- -
window.ongamepadconnected = function() { ... };
-
- -

示例

- -
window.ongamepadconnected = function(event) {
-  // 手柄上所有的可用按键和手柄控制元件上各轴向数值都能在此获取
-  event.gamepad;
-};
- -

规范

- - - - - - - - - - - - - - -
SpecificationStatusComment
{{SpecName('Gamepad ', '#event-gamepadconnected', 'gamepadconnected event')}}{{Spec2('Gamepad')}}Initial definition
- -

浏览器兼容性

- - - -

{{Compat("api.Window.ongamepadconnected")}}

- -

相关知识

- - diff --git a/files/zh-cn/web/api/window/ongamepaddisconnected/index.html b/files/zh-cn/web/api/window/ongamepaddisconnected/index.html deleted file mode 100644 index 7712dd6066..0000000000 --- a/files/zh-cn/web/api/window/ongamepaddisconnected/index.html +++ /dev/null @@ -1,51 +0,0 @@ ---- -title: Window.ongamepaddisconnected -slug: Web/API/Window/ongamepaddisconnected -translation_of: Web/API/Window/ongamepaddisconnected ---- -
{{DefaultAPISidebar("Gamepad API")}}{{SeeCompatTable}}
- -

The ongamepaddisconnected property of the {{domxref("Window")}} interface represents an event handler that will run when a gamepad is disconnected (when the {{event('gamepaddisconnected')}} event fires).

- -

The event object is of type {{domxref("GamepadEvent")}}.

- -

解析

- -
window.ongamepaddisconnected = function() { ... };
-
- -

示例

- -
window.ongamepaddisconnected = function() {
-  // A gamepad has been disconnected
-};
- -

Specifications

- - - - - - - - - - - - - - -
SpecificationStatusComment
{{SpecName('Gamepad ', '#event-gamepaddisconnected', 'gamepaddisconnected event')}}{{Spec2('Gamepad')}}Initial definition
- -

Browser compatibility

- - - -

{{Compat("api.Window.ongamepaddisconnected")}}

- -

See also

- - -- cgit v1.2.3-54-g00ecf