From 33058f2b292b3a581333bdfb21b8f671898c5060 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:40:17 -0500 Subject: initial commit --- files/zh-cn/web/api/midiconnectionevent/index.html | 56 ++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 files/zh-cn/web/api/midiconnectionevent/index.html (limited to 'files/zh-cn/web/api/midiconnectionevent/index.html') diff --git a/files/zh-cn/web/api/midiconnectionevent/index.html b/files/zh-cn/web/api/midiconnectionevent/index.html new file mode 100644 index 0000000000..20341c86d9 --- /dev/null +++ b/files/zh-cn/web/api/midiconnectionevent/index.html @@ -0,0 +1,56 @@ +--- +title: MIDIConnectionEvent +slug: Web/API/MIDIConnectionEvent +tags: + - API + - Draft + - MIDI + - 接口 +translation_of: Web/API/MIDIConnectionEvent +--- +

{{APIRef("Web MIDI API")}}{{SeeCompatTable}}

+ +

The MIDIConnectionEvent interface of the Web MIDI API is the event passed to the {{domxref("MIDIAccess.onstatechange","onstatechange")}} event of the {{domxref("MIDIAccess")}} interface and the {{domxref("MIDIPorts.onstatechange","onstatechange")}} event of the {{domxref("MIDIPorts")}} interface. This occurs any time a new port becomes available, or when a previously available port becomes unavailable. 例如,这个事件无论是在一个 MIDI 设备插入或拔出设备时都会触发。

+ +

构造函数

+ +
+
{{domxref("MIDIConnectionEvent.MIDIConnectionEvent")}}
+
创建一个新的 MIDIConnectionEvent 对象。
+
+ +

属性

+ +
+
{{domxref("MIDIConnectionEvent.port")}}
+
返回一个 {{domxref("MIDIPort")}} 实例的引用,指明其端口是否已经连接。
+
+ +

举例

+ +

 

+ +

规范

+ + + + + + + + + + + + + + +
规范状态备注
{{SpecName('WebMIDI API','#midiconnectionevent-interface')}}{{Spec2('WebMIDI API')}}Initial definition.
+ +

浏览器兼容

+ +
+ + +

{{Compat("api.MIDIConnectionEvent")}}

+
-- cgit v1.2.3-54-g00ecf