Skip to content

Transaction.isUserEvent method

Transaction › isUserEvent

Official

Returns true if the transaction has a user event annotation that is equal to or more specific than event.

Signature:

isUserEvent(event: string): boolean

Parameters:

Parameter Type Description
event string The event type to check.

Returns: booleanWhether the transaction matches the event.


Unofficial

Check whether the user dedents a line or lines, usually by typing Shift + Tab keys. Included in 'delete' event.

Signature:

isUserEvent(event: "delete.dedent"): boolean

Parameters:

Parameter Type Description
event "delete.dedent" The event type to check.

Returns: booleanWhether the transaction matches the event.


Unofficial

Check whether the user deletes a line or lines, usually by typing Ctrl + Shift + K keys. Included in 'delete' event.

Signature:

isUserEvent(event: "delete.line"): boolean

Parameters:

Parameter Type Description
event "delete.line" The event type to check.

Returns: booleanWhether the transaction matches the event.


Unofficial

Check whether the user inputs a content through Obsidian editor suggest autocompletion. Currently, this event is only dispatched when autocompleting a wikilink or inserting Markdown link through command. Included in 'input' event.

Signature:

isUserEvent(event: "input.autocomplete"): boolean

Parameters:

Parameter Type Description
event "input.autocomplete" The event type to check.

Returns: booleanWhether the transaction matches the event.


Unofficial

Check whether the user creates a copy of the selected lines. Usually dispatched when performing copyLineUp or copyLineDown commands. Included in 'input' event.

Signature:

isUserEvent(event: "input.copyline"): boolean

Parameters:

Parameter Type Description
event "input.copyline" The event type to check.

Returns: booleanWhether the transaction matches the event.


Unofficial

Check whether the user indents a line or lines, usually by typing Tab key. Included in 'input' event.

Signature:

isUserEvent(event: "input.indent"): boolean

Parameters:

Parameter Type Description
event "input.indent" The event type to check.

Returns: booleanWhether the transaction matches the event.


Unofficial

Check whether the user replaces all search matches. Usually dispatched when performing replaceAll command. Included in 'input' and 'input.replace' events.

Signature:

isUserEvent(event: "input.replace.matches"): boolean

Parameters:

Parameter Type Description
event "input.replace.matches" The event type to check.

Returns: booleanWhether the transaction matches the event.

Remarks:

Obsidian native editor search does not dispatch this event.

Unofficial

Check whether the user replaces search match(es). Usually dispatched when performing replaceNext or replaceAll commands. Included in 'input' event.

Signature:

isUserEvent(event: "input.replace"): boolean

Parameters:

Parameter Type Description
event "input.replace" The event type to check.

Returns: booleanWhether the transaction matches the event.

Remarks:

Obsidian native editor search does not dispatch this event.

Unofficial

Check whether the user starts a composition input sequence. Included in 'input', 'input.type', and 'input.type.compose' events.

Signature:

isUserEvent(event: "input.type.compose.start"): boolean

Parameters:

Parameter Type Description
event "input.type.compose.start" The event type to check.

Returns: booleanWhether the transaction matches the event.


Unofficial

Check whether the user flips the characters before and after the cursor(s). Usually dispatched when performing transposeChars command. Included in 'move' event.

Signature:

isUserEvent(event: "move.character"): boolean

Parameters:

Parameter Type Description
event "move.character" The event type to check.

Returns: booleanWhether the transaction matches the event.


Unofficial

Check whether the user moves the selected line up or down. Usually dispatched when performing moveLineUp or moveLineDown commands. Included in 'move' event.

Signature:

isUserEvent(event: "move.line"): boolean

Parameters:

Parameter Type Description
event "move.line" The event type to check.

Returns: booleanWhether the transaction matches the event.


Unofficial

Check whether the transaction is triggered by a scroll action.

Signature:

isUserEvent(event: "scroll"): boolean

Parameters:

Parameter Type Description
event "scroll" The event type to check.

Returns: booleanWhether the transaction matches the event.


Unofficial

Check whether the user redoes a selection change. Usually dispatched when performing redoSelection command. Included in 'select' event.

Signature:

isUserEvent(event: "select.redo"): boolean

Parameters:

Parameter Type Description
event "select.redo" The event type to check.

Returns: booleanWhether the transaction matches the event.


Unofficial

Check whether the user selects all search matches. Usually dispatched when performing selectMatches and selectSelectionMatches commands. Included in 'select' event.

Signature:

isUserEvent(event: "select.search.matches"): boolean

Parameters:

Parameter Type Description
event "select.search.matches" The event type to check.

Returns: booleanWhether the transaction matches the event.

Remarks:

Obsidian native editor search does not dispatch this event.

Unofficial

Check whether the user selects search match(es). Usually dispatched when performing findNext and findPrevious commands. Included in 'select' and 'select.search' events.

Signature:

isUserEvent(event: "select.search"): boolean

Parameters:

Parameter Type Description
event "select.search" The event type to check.

Returns: booleanWhether the transaction matches the event.

Remarks:

Obsidian native editor search does not dispatch this event.

Unofficial

Check whether the user undoes a selection change. Usually dispatched when performing undoSelection command. Included in 'select' event.

Signature:

isUserEvent(event: "select.undo"): boolean

Parameters:

Parameter Type Description
event "select.undo" The event type to check.

Returns: booleanWhether the transaction matches the event.


Unofficial

Check whether a content change is not made explicitly by the user. It happens in some circumstances, for instance: - Change made externally, e.g. by other text editor programs. - Change made by another editor view that holds the same note. - Change made by the vault, file manager, and file system API.

Signature:

isUserEvent(event: "set"): boolean

Parameters:

Parameter Type Description
event "set" The event type to check.

Returns: booleanWhether the transaction matches the event.