dom / latest / midimessageevent / midimessageevent.html /

MIDIMessageEvent.MIDIMessageEvent()

Secure context: This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.

The MIDIMessageEvent() constructor creates a new MIDIMessageEvent object. Typically this constructor is not used as events are created when a MIDIInput finishes receiving one or more MIDI messages.

Syntax

new MIDIMessageEvent(type);
new MIDIMessageEvent(type, MIDIMessageEventInit);

Parameters

type

Will always be 'MIDIMessageEvent'.

MIDIMessageEventInit Optional

A dictionary including the following fields:

port

The MIDIPort instance representing the port that has connected or disconnected.

bubbles Optional

A boolean value indicating whether the event bubbles. The default is false.

cancelable Optional

A boolean value indicating whether the event can be cancelled. The default is false.

composed Optional

A boolean value indicating whether the event will trigger listeners outside of a shadow root (see Event.composed for details). The default is false.

Specifications

Browser compatibility

Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari WebView Android Chrome Android Firefox for Android Opera Android Safari on IOS Samsung Internet
MIDIMessageEvent
43
79
100
97-100
No
30
No
No
43
No
30
No
4.0

© 2005–2021 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/MIDIMessageEvent/MIDIMessageEvent