Skip to content

WorkspaceScope

Unofficial

The workspace’s key scope, which delegates each keypress to a scope chosen at the time of the press.

Import:

import type { WorkspaceScope } from '@obsidian-typings/obsidian-public-latest';

Signature:

export interface WorkspaceScope extends Scope

Extends: Scope

Constructor

new WorkspaceScope(parent?: Scope)

Constructor.

To get the constructor instance, use getScopeConstructor from obsidian-typings/implementations.

Properties

PropertyTypeDescription
keysKeyScope[]Overridden keys that exist in this scope.
(Inherited from Scope)
parentScope | undefinedobsidian#Scope that this scope is a child of
(Inherited from Scope)
tabFocusContainerElHTMLElement | nullContainer element that constrains tab-key focus cycling.
(Inherited from Scope)
winnull | WindowThe window this scope is bound to, or null when not bound to a specific window.
(Inherited from Scope)

Methods

MethodReturnsDescription
cb()null | ScopeReturns the scope to hand the keypress to, the active leaf's view scope for the workspace. When it returns null, the keypress is handled by this scope's own keys and then its parent.
handleKey($event, keypress)unknownExecute keypress within this scope.
(Inherited from Scope)
register(modifiers, key, func)KeymapEventHandlerAdd a keymap event handler to this scope.
(Inherited from Scope)
setTabFocusContainerEl(containerEl)voidSets the container element used for tab-focus handling.
(Inherited from Scope)
unregister(handler)voidRemove an existing keymap event handler.
(Inherited from Scope)

Links to this page: