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
onmousedown:
| EventHandler<Input, GlobalMouseButtonPayload>
| null
| undefined;Defined in: types/desktop-engine.d.ts:4014
mousedown callback
onmousemove
onmousemove:
| EventHandler<Input, GlobalPoint>
| null
| undefined;Defined in: types/desktop-engine.d.ts:4010
mousemove callback
onmouseup
onmouseup:
| EventHandler<Input, GlobalMouseButtonPayload>
| null
| undefined;Defined in: types/desktop-engine.d.ts:4018
mouseup callback
onwheel
onwheel:
| EventHandler<Input, GlobalWheelPayload>
| null
| undefined;Defined in: types/desktop-engine.d.ts:4022
wheel callback
pointer
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()
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
| Parameter | Type |
|---|---|
type | K | `on${K}` |
listener | EventHandler<Input, InputEventMap[K]> |
Returns
void
Inherited from
EventedObject.addEventListener
destroy()
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
offmousedown()
offmousedown(): void;Defined in: types/desktop-engine.d.ts:4016
Removes the onmousedown callback
Returns
void
offmousemove()
offmousemove(): void;Defined in: types/desktop-engine.d.ts:4012
Removes the onmousemove callback
Returns
void
offmouseup()
offmouseup(): void;Defined in: types/desktop-engine.d.ts:4020
Removes the onmouseup callback
Returns
void
offwheel()
offwheel(): void;Defined in: types/desktop-engine.d.ts:4024
Removes the onwheel callback
Returns
void
removeEventListener()
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
| Parameter | Type |
|---|---|
type | K | `on${K}` |
listener | EventHandler<Input, InputEventMap[K]> |
Returns
void
