InputsManager
See source codeTable of contents
- accelKey
- altKey
- buttons
- ctrlKey
- currentPagePoint
- currentScreenPoint
- isDragging
- isEditing
- isPanning
- isPen
- isPinching
- isPointing
- isSpacebarPanning
- keys
- metaKey
- originPagePoint
- originScreenPoint
- pointerVelocity
- previousPagePoint
- previousScreenPoint
- shiftKey
- Properties
- Methods
- getAccelKey
- getAltKey
- getCtrlKey
- getCurrentPagePoint
- getCurrentScreenPoint
- getIsDragging
- getIsEditing
- getIsPanning
- getIsPen
- getIsPinching
- getIsPointing
- getIsSpacebarPanning
- getMetaKey
- getOriginPagePoint
- getOriginScreenPoint
- getPointerVelocity
- getPreviousPagePoint
- getPreviousScreenPoint
- getShiftKey
- setIsDragging
- setIsEditing
- setIsPen
- toJson
class InputsManager {}Constructor
Constructs a new instance of the InputsManager class
Parameters
| Name | Description |
|---|---|
|
Properties
accelKey
Deprecated:
Use getAccelKey() instead.
get accelKey(): booleanaltKey
Deprecated:
Use getAltKey() instead.
get altKey(): boolean
set altKey(altKey: boolean)buttons
A set containing the currently pressed buttons.
readonly buttons: AtomSet<number>ctrlKey
Deprecated:
Use getCtrlKey() instead.
get ctrlKey(): boolean
set ctrlKey(ctrlKey: boolean)currentPagePoint
Deprecated:
Use getCurrentPagePoint() instead.
get currentPagePoint(): VeccurrentScreenPoint
Deprecated:
Use getCurrentScreenPoint() instead.
get currentScreenPoint(): VecisDragging
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
A set containing the currently pressed keys.
readonly keys: AtomSet<string>metaKey
Deprecated:
Use getMetaKey() instead.
get metaKey(): boolean
set metaKey(metaKey: boolean)originPagePoint
Deprecated:
Use getOriginPagePoint() instead.
get originPagePoint(): VecoriginScreenPoint
Deprecated:
Use getOriginScreenPoint() instead.
get originScreenPoint(): VecpointerVelocity
Deprecated:
Use getPointerVelocity() instead.
get pointerVelocity(): VecpreviousPagePoint
Deprecated:
Use getPreviousPagePoint() instead.
get previousPagePoint(): VecpreviousScreenPoint
Deprecated:
Use getPreviousScreenPoint() instead.
get previousScreenPoint(): VecshiftKey
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(): booleangetAltKey( )
Whether the alt or option key is currently pressed.
getAltKey(): booleangetCtrlKey( )
Whether the ctrl or command key is currently pressed.
getCtrlKey(): booleangetCurrentPagePoint( )
The most recent pointer position in the current page space.
getCurrentPagePoint(): VecgetCurrentScreenPoint( )
The most recent pointer position in screen space.
getCurrentScreenPoint(): VecgetIsDragging( )
Whether the user is dragging.
getIsDragging(): booleangetIsEditing( )
Whether the user is editing.
getIsEditing(): booleangetIsPanning( )
Whether the user is panning.
getIsPanning(): booleangetIsPen( )
Whether the input is from a pen.
getIsPen(): booleangetIsPinching( )
Whether the user is pinching.
getIsPinching(): booleangetIsPointing( )
Whether the user is pointing.
getIsPointing(): booleangetIsSpacebarPanning( )
Whether the user is spacebar panning.
getIsSpacebarPanning(): booleangetMetaKey( )
Whether the meta key is currently pressed.
getMetaKey(): booleangetOriginPagePoint( )
The most recent pointer down's position in the current page space.
getOriginPagePoint(): VecgetOriginScreenPoint( )
The most recent pointer down's position in screen space.
getOriginScreenPoint(): VecgetPointerVelocity( )
Velocity of mouse pointer, in pixels per millisecond.
getPointerVelocity(): VecgetPreviousPagePoint( )
The previous pointer position in the current page space.
getPreviousPagePoint(): VecgetPreviousScreenPoint( )
The previous pointer position in screen space.
getPreviousScreenPoint(): VecgetShiftKey( )
Whether the shift key is currently pressed.
getShiftKey(): booleansetIsDragging( )
setIsDragging(isDragging: boolean): voidParameters
| Name | Description |
|---|---|
| Whether the user is dragging. |
Returns
voidsetIsEditing( )
setIsEditing(isEditing: boolean): voidParameters
| Name | Description |
|---|---|
| Whether the user is editing. |
Returns
voidsetIsPen( )
setIsPen(isPen: boolean): voidParameters
| Name | Description |
|---|---|
| Whether the input is from a pen. |
Returns
voidtoJson( )
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
}