InputsManager

See source code
Table of contents
class InputsManager {}

Constructor

Constructs a new instance of the InputsManager class

Parameters

NameDescription

editor

Editor

Properties

accelKey

readonly

Deprecated: Use getAccelKey() instead.

get accelKey(): boolean

altKey

Deprecated: Use getAltKey() instead.

get altKey(): boolean

set altKey(altKey: boolean)

buttons

readonly

A set containing the currently pressed buttons.

readonly buttons: AtomSet<number>

ctrlKey

Deprecated: Use getCtrlKey() instead.

get ctrlKey(): boolean

set ctrlKey(ctrlKey: boolean)

currentPagePoint

readonly

Deprecated: Use getCurrentPagePoint() instead.

get currentPagePoint(): Vec

currentScreenPoint

readonly

Deprecated: Use getCurrentScreenPoint() instead.

get currentScreenPoint(): Vec

isDragging

Soon to be deprecated, use getIsDragging() instead.

get isDragging(): boolean

set isDragging(isDragging: boolean)

isEditing

Deprecated: Use getIsEditing() instead.

get isEditing(): boolean

set isEditing(isEditing: boolean)

isPanning

Deprecated: Use getIsPanning() instead.

get isPanning(): boolean

set isPanning(isPanning: boolean)

isPen

Deprecated: Use getIsPen() instead.

get isPen(): boolean

set isPen(isPen: boolean)

isPinching

Deprecated: Use getIsPinching() instead.

get isPinching(): boolean

set isPinching(isPinching: boolean)

isPointing

Deprecated: Use getIsPointing() instead.

get isPointing(): boolean

set isPointing(isPointing: boolean)

isSpacebarPanning

Deprecated: Use getIsSpacebarPanning() instead.

get isSpacebarPanning(): boolean

set isSpacebarPanning(isSpacebarPanning: boolean)

keys

readonly

A set containing the currently pressed keys.

readonly keys: AtomSet<string>

metaKey

Deprecated: Use getMetaKey() instead.

get metaKey(): boolean

set metaKey(metaKey: boolean)

originPagePoint

readonly

Deprecated: Use getOriginPagePoint() instead.

get originPagePoint(): Vec

originScreenPoint

readonly

Deprecated: Use getOriginScreenPoint() instead.

get originScreenPoint(): Vec

pointerVelocity

readonly

Deprecated: Use getPointerVelocity() instead.

get pointerVelocity(): Vec

previousPagePoint

readonly

Deprecated: Use getPreviousPagePoint() instead.

get previousPagePoint(): Vec

previousScreenPoint

readonly

Deprecated: Use getPreviousScreenPoint() instead.

get previousScreenPoint(): Vec

shiftKey

Deprecated: Use getShiftKey() instead.

get shiftKey(): boolean

set shiftKey(shiftKey: boolean)

Methods

getAccelKey( )

Is the accelerator key (cmd on mac, ctrl elsewhere) currently pressed.

getAccelKey(): boolean

getAltKey( )

Whether the alt or option key is currently pressed.

getAltKey(): boolean

getCtrlKey( )

Whether the ctrl or command key is currently pressed.

getCtrlKey(): boolean

getCurrentPagePoint( )

The most recent pointer position in the current page space.

getCurrentPagePoint(): Vec

getCurrentScreenPoint( )

The most recent pointer position in screen space.

getCurrentScreenPoint(): Vec

getIsDragging( )

Whether the user is dragging.

getIsDragging(): boolean

getIsEditing( )

Whether the user is editing.

getIsEditing(): boolean

getIsPanning( )

Whether the user is panning.

getIsPanning(): boolean

getIsPen( )

Whether the input is from a pen.

getIsPen(): boolean

getIsPinching( )

Whether the user is pinching.

getIsPinching(): boolean

getIsPointing( )

Whether the user is pointing.

getIsPointing(): boolean

getIsSpacebarPanning( )

Whether the user is spacebar panning.

getIsSpacebarPanning(): boolean

getMetaKey( )

Whether the meta key is currently pressed.

getMetaKey(): boolean

getOriginPagePoint( )

The most recent pointer down's position in the current page space.

getOriginPagePoint(): Vec

getOriginScreenPoint( )

The most recent pointer down's position in screen space.

getOriginScreenPoint(): Vec

getPointerVelocity( )

Velocity of mouse pointer, in pixels per millisecond.

getPointerVelocity(): Vec

getPreviousPagePoint( )

The previous pointer position in the current page space.

getPreviousPagePoint(): Vec

getPreviousScreenPoint( )

The previous pointer position in screen space.

getPreviousScreenPoint(): Vec

getShiftKey( )

Whether the shift key is currently pressed.

getShiftKey(): boolean

setIsDragging( )

setIsDragging(isDragging: boolean): void

Parameters

NameDescription

isDragging

boolean

Whether the user is dragging.

Returns

void

setIsEditing( )

setIsEditing(isEditing: boolean): void

Parameters

NameDescription

isEditing

boolean

Whether the user is editing.

Returns

void

setIsPen( )

setIsPen(isPen: boolean): void

Parameters

NameDescription

isPen

boolean

Whether the input is from a pen.

Returns

void

toJson( )

toJson(): {
  altKey: boolean
  buttons: number[]
  ctrlKey: boolean
  currentPagePoint: import('@tldraw/tlschema').VecModel
  currentScreenPoint: import('@tldraw/tlschema').VecModel
  isDragging: boolean
  isEditing: boolean
  isPanning: boolean
  isPen: boolean
  isPinching: boolean
  isPointing: boolean
  isSpacebarPanning: boolean
  keys: string[]
  metaKey: boolean
  originPagePoint: import('@tldraw/tlschema').VecModel
  originScreenPoint: import('@tldraw/tlschema').VecModel
  pointerVelocity: import('@tldraw/tlschema').VecModel
  previousPagePoint: import('@tldraw/tlschema').VecModel
  previousScreenPoint: import('@tldraw/tlschema').VecModel
  shiftKey: boolean
}

Prev
HistoryManager
Next
Mat