Transaction.isUserEvent method
Transaction › isUserEvent
Official
Returnstrue if the transaction has a user event annotation that is equal to or more specific than event. Signature:
isUserEvent(event: string): booleanParameters:
| Parameter | Type | Description |
|---|---|---|
| event | string | The event type to check. |
Returns: boolean — Whether the transaction matches the event.
Unofficial
Check whether the user dedents a line or lines, usually by typingShift + Tab keys. Included in 'delete' event. Signature:
isUserEvent(event: "delete.dedent"): booleanParameters:
| Parameter | Type | Description |
|---|---|---|
| event | "delete.dedent" | The event type to check. |
Returns: boolean — Whether the transaction matches the event.
Unofficial
Check whether the user deletes a line or lines, usually by typingCtrl + Shift + K keys. Included in 'delete' event. Signature:
isUserEvent(event: "delete.line"): booleanParameters:
| Parameter | Type | Description |
|---|---|---|
| event | "delete.line" | The event type to check. |
Returns: boolean — Whether 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"): booleanParameters:
| Parameter | Type | Description |
|---|---|---|
| event | "input.autocomplete" | The event type to check. |
Returns: boolean — Whether the transaction matches the event.
Unofficial
Check whether the user creates a copy of the selected lines. Usually dispatched when performingcopyLineUp or copyLineDown commands. Included in 'input' event. Signature:
isUserEvent(event: "input.copyline"): booleanParameters:
| Parameter | Type | Description |
|---|---|---|
| event | "input.copyline" | The event type to check. |
Returns: boolean — Whether the transaction matches the event.
Unofficial
Check whether the user indents a line or lines, usually by typingTab key. Included in 'input' event. Signature:
isUserEvent(event: "input.indent"): booleanParameters:
| Parameter | Type | Description |
|---|---|---|
| event | "input.indent" | The event type to check. |
Returns: boolean — Whether the transaction matches the event.
Unofficial
Check whether the user replaces all search matches. Usually dispatched when performingreplaceAll command. Included in 'input' and 'input.replace' events. Signature:
isUserEvent(event: "input.replace.matches"): booleanParameters:
| Parameter | Type | Description |
|---|---|---|
| event | "input.replace.matches" | The event type to check. |
Returns: boolean — Whether 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 performingreplaceNext or replaceAll commands. Included in 'input' event. Signature:
isUserEvent(event: "input.replace"): booleanParameters:
| Parameter | Type | Description |
|---|---|---|
| event | "input.replace" | The event type to check. |
Returns: boolean — Whether 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"): booleanParameters:
| Parameter | Type | Description |
|---|---|---|
| event | "input.type.compose.start" | The event type to check. |
Returns: boolean — Whether the transaction matches the event.
Unofficial
Check whether the user flips the characters before and after the cursor(s). Usually dispatched when performingtransposeChars command. Included in 'move' event. Signature:
isUserEvent(event: "move.character"): booleanParameters:
| Parameter | Type | Description |
|---|---|---|
| event | "move.character" | The event type to check. |
Returns: boolean — Whether the transaction matches the event.
Unofficial
Check whether the user moves the selected line up or down. Usually dispatched when performingmoveLineUp or moveLineDown commands. Included in 'move' event. Signature:
isUserEvent(event: "move.line"): booleanParameters:
| Parameter | Type | Description |
|---|---|---|
| event | "move.line" | The event type to check. |
Returns: boolean — Whether the transaction matches the event.
Unofficial
Check whether the transaction is triggered by a scroll action.Signature:
isUserEvent(event: "scroll"): booleanParameters:
| Parameter | Type | Description |
|---|---|---|
| event | "scroll" | The event type to check. |
Returns: boolean — Whether the transaction matches the event.
Unofficial
Check whether the user redoes a selection change. Usually dispatched when performingredoSelection command. Included in 'select' event. Signature:
isUserEvent(event: "select.redo"): booleanParameters:
| Parameter | Type | Description |
|---|---|---|
| event | "select.redo" | The event type to check. |
Returns: boolean — Whether the transaction matches the event.
Unofficial
Check whether the user selects all search matches. Usually dispatched when performingselectMatches and selectSelectionMatches commands. Included in 'select' event. Signature:
isUserEvent(event: "select.search.matches"): booleanParameters:
| Parameter | Type | Description |
|---|---|---|
| event | "select.search.matches" | The event type to check. |
Returns: boolean — Whether 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 performingfindNext and findPrevious commands. Included in 'select' and 'select.search' events. Signature:
isUserEvent(event: "select.search"): booleanParameters:
| Parameter | Type | Description |
|---|---|---|
| event | "select.search" | The event type to check. |
Returns: boolean — Whether 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 performingundoSelection command. Included in 'select' event. Signature:
isUserEvent(event: "select.undo"): booleanParameters:
| Parameter | Type | Description |
|---|---|---|
| event | "select.undo" | The event type to check. |
Returns: boolean — Whether 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"): booleanParameters:
| Parameter | Type | Description |
|---|---|---|
| event | "set" | The event type to check. |
Returns: boolean — Whether the transaction matches the event.