Skip to content

Interface: Input ​

Defined in: types/desktop-engine.d.ts:4001

The mouse anywhere on screen, over other apps too (DesktopEngine.input), e.g. for a companion whose eyes follow the pointer. Needs the "mouse" permission in manifest.json (and "apiVersion": 3). The app watches the mouse only while the content listens to its events.

Extends ​

Properties ​

onmousedown ​

ts
onmousedown: 
  | EventHandler<Input, GlobalMouseButtonPayload>
  | null
  | undefined;

Defined in: types/desktop-engine.d.ts:4014

mousedown callback


onmousemove ​

ts
onmousemove: 
  | EventHandler<Input, GlobalPoint>
  | null
  | undefined;

Defined in: types/desktop-engine.d.ts:4010

mousemove callback


onmouseup ​

ts
onmouseup: 
  | EventHandler<Input, GlobalMouseButtonPayload>
  | null
  | undefined;

Defined in: types/desktop-engine.d.ts:4018

mouseup callback


onwheel ​

ts
onwheel: 
  | EventHandler<Input, GlobalWheelPayload>
  | null
  | undefined;

Defined in: types/desktop-engine.d.ts:4022

wheel callback


pointer ​

ts
readonly pointer: GlobalPoint | null;

Defined in: types/desktop-engine.d.ts:4003

Where the pointer is now, in global coordinates; null without the "mouse" permission

Methods ​

addEventListener() ​

ts
addEventListener<K>(type, listener): void;

Defined in: types/desktop-engine.d.ts:143

Adds an event listener; type may be given with or without the on prefix

Type Parameters ​

Type Parameter
K extends "mousemove" | "mousedown" | "mouseup" | "wheel"

Parameters ​

ParameterType
typeK | `on${K}`
listenerEventHandler<Input, InputEventMap[K]>

Returns ​

void

Inherited from ​

EventedObject.addEventListener


destroy() ​

ts
destroy(): void;

Defined in: types/desktop-engine.d.ts:147

Clears all event listeners and on callbacks so the object can be garbage-collected; components also process their children recursively

Returns ​

void

Inherited from ​

EventedObject.destroy


offmousedown() ​

ts
offmousedown(): void;

Defined in: types/desktop-engine.d.ts:4016

Removes the onmousedown callback

Returns ​

void


offmousemove() ​

ts
offmousemove(): void;

Defined in: types/desktop-engine.d.ts:4012

Removes the onmousemove callback

Returns ​

void


offmouseup() ​

ts
offmouseup(): void;

Defined in: types/desktop-engine.d.ts:4020

Removes the onmouseup callback

Returns ​

void


offwheel() ​

ts
offwheel(): void;

Defined in: types/desktop-engine.d.ts:4024

Removes the onwheel callback

Returns ​

void


removeEventListener() ​

ts
removeEventListener<K>(type, listener): void;

Defined in: types/desktop-engine.d.ts:145

Removes the given event listener

Type Parameters ​

Type Parameter
K extends "mousemove" | "mousedown" | "mouseup" | "wheel"

Parameters ​

ParameterType
typeK | `on${K}`
listenerEventHandler<Input, InputEventMap[K]>

Returns ​

void

Inherited from ​

EventedObject.removeEventListener

The SDK is released under the Apache License 2.0