Skip to content

LyricLineMouseEvent

This content is not available in your language yet.

Defined in: packages/core/src/lyric-player/dom/index.ts:18

歌词行鼠标相关事件,可以获取到歌词行的索引、主歌词行以及背景歌词行(如果有)元素

  • MouseEvent

new LyricLineMouseEvent(
lineIndex,
line,
bgLine,
event): LyricLineMouseEvent;

Defined in: packages/core/src/lyric-player/dom/index.ts:24

ParameterTypeDescription
lineIndexnumber歌词行索引
lineLyricLineBase歌词行元素
bgLineLyricLineBase | undefined背景人声歌词行元素 (如果存在)
eventMouseEvent-

LyricLineMouseEvent

MouseEvent.constructor
PropertyModifierTypeDefault valueDescriptionInherited fromDefined in
altKeyreadonlybooleanundefinedThe MouseEvent.altKey read-only property is a boolean value that indicates whether the alt key was pressed or not when a given mouse event occurs. MDN ReferenceMouseEvent.altKeynode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.dom.d.ts:25020
AT_TARGETreadonly2undefined-MouseEvent.AT_TARGETnode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.dom.d.ts:14273
bgLinereadonlyLyricLineBase | undefinedundefined背景人声歌词行元素 (如果存在)-packages/core/src/lyric-player/dom/index.ts:36
bubblesreadonlybooleanundefinedThe bubbles read-only property of the Event interface indicates whether the event bubbles up through the DOM tree or not. MDN ReferenceMouseEvent.bubblesnode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.dom.d.ts:14164
BUBBLING_PHASEreadonly3undefined-MouseEvent.BUBBLING_PHASEnode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.dom.d.ts:14274
buttonreadonlynumberundefinedThe MouseEvent.button read-only property indicates which button was pressed or released on the mouse to trigger the event. MDN ReferenceMouseEvent.buttonnode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.dom.d.ts:25026
buttonsreadonlynumberundefinedThe MouseEvent.buttons read-only property indicates which buttons are pressed on the mouse (or other input device) when a mouse event is triggered. MDN ReferenceMouseEvent.buttonsnode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.dom.d.ts:25032
cancelablereadonlybooleanundefinedThe cancelable read-only property of the Event interface indicates whether the event can be canceled, and therefore prevented as if the event never happened. MDN ReferenceMouseEvent.cancelablenode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.dom.d.ts:14177
cancelBubblepublicbooleanundefinedThe cancelBubble property of the Event interface is deprecated. Use Event.stopPropagation() instead. Setting its value to true before returning from an event handler prevents propagation of the event. In later implementations, setting this to false does nothing. See Browser compatibility for details. Deprecated MDN ReferenceMouseEvent.cancelBubblenode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.dom.d.ts:14171
CAPTURING_PHASEreadonly1undefined-MouseEvent.CAPTURING_PHASEnode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.dom.d.ts:14272
clientXreadonlynumberundefinedThe clientX read-only property of the MouseEvent interface provides the horizontal coordinate within the application’s viewport at which the event occurred (as opposed to the coordinate within the page). MDN ReferenceMouseEvent.clientXnode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.dom.d.ts:25038
clientYreadonlynumberundefinedThe clientY read-only property of the MouseEvent interface provides the vertical coordinate within the application’s viewport at which the event occurred (as opposed to the coordinate within the page). MDN ReferenceMouseEvent.clientYnode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.dom.d.ts:25044
composedreadonlybooleanundefinedThe read-only composed property of the Event interface returns a boolean value which indicates whether or not the event will propagate across the shadow DOM boundary into the standard DOM. MDN ReferenceMouseEvent.composednode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.dom.d.ts:14183
ctrlKeyreadonlybooleanundefinedThe MouseEvent.ctrlKey read-only property is a boolean value that indicates whether the ctrl key was pressed or not when a given mouse event occurs. MDN ReferenceMouseEvent.ctrlKeynode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.dom.d.ts:25050
currentTargetreadonlyEventTarget | nullundefinedThe currentTarget read-only property of the Event interface identifies the element to which the event handler has been attached. MDN ReferenceMouseEvent.currentTargetnode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.dom.d.ts:14189
defaultPreventedreadonlybooleanundefinedThe defaultPrevented read-only property of the Event interface returns a boolean value indicating whether or not the call to Event.preventDefault() canceled the event. MDN ReferenceMouseEvent.defaultPreventednode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.dom.d.ts:14195
detailreadonlynumberundefinedThe UIEvent.detail read-only property, when non-zero, provides the current (or next, depending on the event) click count. MDN ReferenceMouseEvent.detailnode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.dom.d.ts:37281
eventPhasereadonlynumberundefinedThe eventPhase read-only property of the Event interface indicates which phase of the event flow is currently being evaluated. MDN ReferenceMouseEvent.eventPhasenode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.dom.d.ts:14201
isPropagationStoppedpublicbooleanfalse自定义标志位,用于记录外部是否调用了 stopPropagation-packages/core/src/lyric-player/dom/index.ts:22
isTrustedreadonlybooleanundefinedThe isTrusted read-only property of the Event interface is a boolean value that is true when the event was generated by the user agent (including via user actions and programmatic methods such as HTMLElement.focus()), and false when the event was dispatched via EventTarget.dispatchEvent(). The only exception is the click event, which initializes the isTrusted property to false in user agents. MDN ReferenceMouseEvent.isTrustednode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.dom.d.ts:14207
layerXreadonlynumberundefinedThe MouseEvent.layerX read-only property returns the horizontal coordinate of the event relative to the current layer. MDN ReferenceMouseEvent.layerXnode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.dom.d.ts:25056
layerYreadonlynumberundefinedThe MouseEvent.layerY read-only property returns the vertical coordinate of the event relative to the current layer. MDN ReferenceMouseEvent.layerYnode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.dom.d.ts:25062
linereadonlyLyricLineBaseundefined歌词行元素-packages/core/src/lyric-player/dom/index.ts:32
lineIndexreadonlynumberundefined歌词行索引-packages/core/src/lyric-player/dom/index.ts:28
metaKeyreadonlybooleanundefinedThe MouseEvent.metaKey read-only property is a boolean value that indicates whether the meta key was pressed or not when a given mouse event occurs. MDN ReferenceMouseEvent.metaKeynode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.dom.d.ts:25068
movementXreadonlynumberundefinedThe movementX read-only property of the MouseEvent interface provides the difference in the X coordinate of the mouse (or pointer) between the given move event and the previous move event of the same type. MDN ReferenceMouseEvent.movementXnode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.dom.d.ts:25074
movementYreadonlynumberundefinedThe movementY read-only property of the MouseEvent interface provides the difference in the Y coordinate of the mouse (or pointer) between the given move event and the previous move event of the same type. MDN ReferenceMouseEvent.movementYnode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.dom.d.ts:25080
NONEreadonly0undefined-MouseEvent.NONEnode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.dom.d.ts:14271
offsetXreadonlynumberundefinedThe offsetX read-only property of the MouseEvent interface provides the offset in the X coordinate of the mouse pointer between that event and the padding edge of the target node. MDN ReferenceMouseEvent.offsetXnode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.dom.d.ts:25086
offsetYreadonlynumberundefinedThe offsetY read-only property of the MouseEvent interface provides the offset in the Y coordinate of the mouse pointer between that event and the padding edge of the target node. MDN ReferenceMouseEvent.offsetYnode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.dom.d.ts:25092
pageXreadonlynumberundefinedThe pageX read-only property of the MouseEvent interface returns the X (horizontal) coordinate (in pixels) at which the mouse was clicked, relative to the left edge of the entire document. This includes any portion of the document not currently visible. MDN ReferenceMouseEvent.pageXnode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.dom.d.ts:25098
pageYreadonlynumberundefinedThe pageY read-only property of the MouseEvent interface returns the Y (vertical) coordinate (in pixels) at which the mouse was clicked, relative to the top edge of the entire document. This includes any portion of the document not currently visible. MDN ReferenceMouseEvent.pageYnode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.dom.d.ts:25104
relatedTargetreadonlyEventTarget | nullundefinedThe MouseEvent.relatedTarget read-only property is the secondary target for the mouse event, if there is one. MDN ReferenceMouseEvent.relatedTargetnode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.dom.d.ts:25110
returnValuepublicbooleanundefinedThe Event property returnValue indicates whether the default action for this event has been prevented or not. Deprecated MDN ReferenceMouseEvent.returnValuenode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.dom.d.ts:14214
screenXreadonlynumberundefinedThe screenX read-only property of the MouseEvent interface provides the horizontal coordinate (offset) of the mouse pointer in screen coordinates. MDN ReferenceMouseEvent.screenXnode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.dom.d.ts:25116
screenYreadonlynumberundefinedThe screenY read-only property of the MouseEvent interface provides the vertical coordinate (offset) of the mouse pointer in screen coordinates. MDN ReferenceMouseEvent.screenYnode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.dom.d.ts:25122
shiftKeyreadonlybooleanundefinedThe MouseEvent.shiftKey read-only property is a boolean value that indicates whether the shift key was pressed or not when a given mouse event occurs. MDN ReferenceMouseEvent.shiftKeynode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.dom.d.ts:25128
srcElementreadonlyEventTarget | nullundefinedThe deprecated Event.srcElement is an alias for the Event.target property. Use Event.target instead. Deprecated MDN ReferenceMouseEvent.srcElementnode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.dom.d.ts:14221
targetreadonlyEventTarget | nullundefinedThe read-only target property of the Event interface is a reference to the object onto which the event was dispatched. It is different from Event.currentTarget when the event handler is called during the bubbling or capturing phase of the event. MDN ReferenceMouseEvent.targetnode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.dom.d.ts:14227
timeStampreadonlynumberundefinedThe timeStamp read-only property of the Event interface returns the time (in milliseconds) at which the event was created. MDN ReferenceMouseEvent.timeStampnode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.dom.d.ts:14233
typereadonlystringundefinedThe type read-only property of the Event interface returns a string containing the event’s type. It is set when the event is constructed and is the name commonly used to refer to the specific event, such as click, load, or error. MDN ReferenceMouseEvent.typenode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.dom.d.ts:14239
viewreadonlyWindow | nullundefinedThe UIEvent.view read-only property returns the WindowProxy object from which the event was generated. In browsers, this is the Window object the event happened in. MDN ReferenceMouseEvent.viewnode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.dom.d.ts:37287
whichreadonlynumberundefinedThe UIEvent.which read-only property of the UIEvent interface returns a number that indicates which button was pressed on the mouse, or the numeric keyCode or the character code (charCode) of the key pressed on the keyboard. Deprecated MDN ReferenceMouseEvent.whichnode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.dom.d.ts:37294
xreadonlynumberundefinedThe MouseEvent.x property is an alias for the MouseEvent.clientX property. MDN ReferenceMouseEvent.xnode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.dom.d.ts:25134
yreadonlynumberundefinedThe MouseEvent.y property is an alias for the MouseEvent.clientY property. MDN ReferenceMouseEvent.ynode_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.dom.d.ts:25140

composedPath(): EventTarget[];

Defined in: node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.dom.d.ts:14245

The composedPath() method of the Event interface returns the event’s path which is an array of the objects on which listeners will be invoked. This does not include nodes in shadow trees if the shadow root was created with its ShadowRoot.mode closed.

MDN Reference

EventTarget[]

MouseEvent.composedPath

getModifierState(keyArg): boolean;

Defined in: node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.dom.d.ts:25146

The MouseEvent.getModifierState() method returns the current state of the specified modifier key: true if the modifier is active (i.e., the modifier key is pressed or locked), otherwise, false.

MDN Reference

ParameterType
keyArgstring

boolean

MouseEvent.getModifierState

initEvent(
type,
bubbles?,
cancelable?): void;

Defined in: node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.dom.d.ts:14252

The Event.initEvent() method is used to initialize the value of an event created using Document.createEvent().

ParameterType
typestring
bubbles?boolean
cancelable?boolean

void

MDN Reference

MouseEvent.initEvent

initMouseEvent(
typeArg,
canBubbleArg,
cancelableArg,
viewArg,
detailArg,
screenXArg,
screenYArg,
clientXArg,
clientYArg,
ctrlKeyArg,
altKeyArg,
shiftKeyArg,
metaKeyArg,
buttonArg,
relatedTargetArg): void;

Defined in: node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.dom.d.ts:25153

The MouseEvent.initMouseEvent() method initializes the value of a mouse event once it’s been created (normally using the Document.createEvent() method).

ParameterType
typeArgstring
canBubbleArgboolean
cancelableArgboolean
viewArgWindow
detailArgnumber
screenXArgnumber
screenYArgnumber
clientXArgnumber
clientYArgnumber
ctrlKeyArgboolean
altKeyArgboolean
shiftKeyArgboolean
metaKeyArgboolean
buttonArgnumber
relatedTargetArgEventTarget | null

void

MDN Reference

MouseEvent.initMouseEvent

initUIEvent(
typeArg,
bubblesArg?,
cancelableArg?,
viewArg?,
detailArg?): void;

Defined in: node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.dom.d.ts:37301

The UIEvent.initUIEvent() method initializes a UI event once it’s been created.

ParameterType
typeArgstring
bubblesArg?boolean
cancelableArg?boolean
viewArg?Window | null
detailArg?number

void

MDN Reference

MouseEvent.initUIEvent

preventDefault(): void;

Defined in: node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.dom.d.ts:14258

The preventDefault() method of the Event interface tells the user agent that the event is being explicitly handled, so its default action, such as page scrolling, link navigation, or pasting text, should not be taken.

MDN Reference

void

MouseEvent.preventDefault

stopImmediatePropagation(): void;

Defined in: packages/core/src/lyric-player/dom/index.ts:47

The stopImmediatePropagation() method of the Event interface prevents other listeners of the same event from being called.

MDN Reference

void

MouseEvent.stopImmediatePropagation

stopPropagation(): void;

Defined in: packages/core/src/lyric-player/dom/index.ts:42

The stopPropagation() method of the Event interface prevents further propagation of the current event in the capturing and bubbling phases. It does not, however, prevent any default behaviors from occurring; for instance, clicks on links are still processed. If you want to stop those behaviors, see the preventDefault() method. It also does not prevent propagation to other event-handlers of the current element. If you want to stop those, see stopImmediatePropagation().

MDN Reference

void

MouseEvent.stopPropagation