InputsManager
Table 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(): boolean;altKey
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(): Vec;currentScreenPoint
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
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(): Vec;originScreenPoint
Deprecated:
Use getOriginScreenPoint() instead.
get originScreenPoint(): Vec;pointerVelocity
Deprecated:
Use getPointerVelocity() instead.
get pointerVelocity(): Vec;previousPagePoint
Deprecated:
Use getPreviousPagePoint() instead.
get previousPagePoint(): Vec;previousScreenPoint
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
| Name | Description |
|---|---|
| Whether the user is dragging. |
Returns
void;setIsEditing( )
setIsEditing(isEditing: boolean): void;Parameters
| Name | Description |
|---|---|
| Whether the user is editing. |
Returns
void;setIsPen( )
setIsPen(isPen: boolean): void;Parameters
| Name | Description |
|---|---|
| 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;
};