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 isfalse
.
Specifications
Specification |
---|
Web MIDI API # dom-midimessageevent-constructor |
Browser compatibility
BCD tables only load in the browser