Skip to content

IKeyboardOptions

Type interface

Defines an interface for a keyboar option object.

These are used when controlling draggable elements with keyboard arrows.

Sources

IKeyboardOptions is an interface: it describes a shape of data and is not imported on its own.

Properties

accelleration

Type number

A multiplication factor for move speed growth per second For example if the initial speed is 10px/s (0.01px/ms) and accelleration is 0.5, pressing and holding arrow key will make the element move at 10px/s, then will accellerate to 15px/s after 1s, and so on.

accellerationDelay

Type number

Number of milliseconds before accelleration kicks in.

speed

Type number

Number of pixels to move per millisecond.