Skip to main content

blockly > KeyboardMover

KeyboardMover class

Class responsible for coordinating keyboard-driven moves with the workspace and dragging system.

Signature:

export declare class KeyboardMover

Properties

Property

Modifiers

Type

Description

mover

static

KeyboardMover

Methods

Method

Modifiers

Description

abortMove(event)

Abort moving the currently-focused item on workspace.

canMove(draggable)

Returns true iff the given draggable is allowed to be moved.

finishMove(event)

Finish moving the item that is currently being moved.

getAllowedShortcuts()

Returns a list of the names of shortcuts that are allowed to be run while a keyboard-driven move is in progress.

isMoving()

Returns true iff this Mover is currently moving an element.

move(direction, event)

Moves the current element in the given direction.

setAllowedShortcuts(shortcutNames)

Adds shortcuts with the given names to the list of shortcuts that are allowed to be run while a keyboard-driven move is in progress.

setMoveDistance(stepDistance)

Sets the distance by which an object will be moved.

startMove(draggable, event)

Start moving the currently-focused item on workspace, if possible.