Skip to main content
Module

x/pane/mod.ts>DeviceEvent

🖼️ A deno module providing bindings for cross-platform windowing
Latest
type alias DeviceEvent
import { type DeviceEvent } from "https://deno.land/x/pane@0.2.1/mod.ts";

Represents raw hardware events that are not associated with any particular window.

Useful for interactions that diverge significantly from a conventional 2D GUI, such as 3D camera or first-person game controls. Many physical actions, such as mouse movement, can produce both device and window events. Because window events typically arise from virtual devices (corresponding to GUI cursors and keyboard focus) the device IDs may not match.

Note that these events are delivered regardless of input focus.

definition:
| { type: "added"; }
| { type: "removed"; }
| { type: "mouseMotion"; value: { delta: [number, number]; }; }
| { type: "mouseWheel"; value: { delta: MouseScrollDelta; }; }
| { type: "motion"; value: { axis: AxisId; value: number; }; }
| { type: "button"; value: { button: ButtonId; state: ElementState; }; }
| { type: "key"; value: KeyboardInput; }
| { type: "text"; value: { codepoint: string; }; }