
# tecs.platform.events


One typed platform event stream.

Every platform delivers the same vocabulary through the world's event bus.
Each kind has one ECS event type at address zero:

```teal
world:observe(
    0,
    tecs.platform.events.on.dropFile,
    function(event: tecs.platform.events.Event) loadFile(event.text) end
)

local pending <const>: {tecs.platform.events.Event} = {}
world:observe(
    0,
    tecs.platform.events.on.keyDown,
    function(event: tecs.platform.events.Event)
        pending[#pending + 1] = tecs.platform.events.copy(event)
    end
)
```

The application drains platform events before `world:update`. Observers run
outside every phase and fixed step. The application updates input state before
it emits an event, so an observer sees the new state.

SDL converts `SIGINT` and `SIGTERM` into `events.on.quit`, so an application
uses the same normal shutdown path for a terminal interrupt and a window
close. A headless program without an application uses
`tecs.platform.os.newSignalListener` and drives `tecs.runtime.poll` itself.

## Borrowed records

The converter reuses one wide [`Event`](/modules/platform/events/#tecs.platform.events.Event) record. `kind` determines which payload
fields carry meaning. Read the record during the observer call, or retain an
independent value through `events.copy`.

Mouse and converted touch positions use logical window coordinates.
`timestamp` uses the platform event clock. `arrival` uses the monotonic seconds
returned by `tecs.platform.time.now`, which makes it suitable for input-latency
measurement.

Unrecognized platform events arrive as `unknown` with their numeric type.
Finger and touch-device identities remain opaque strings.

## Synthetic and replayed input

Tests can push an engine event through the host queue:

```teal
tecs.platform.events.push(
    "mouseDown",
    {
        button = 1,
        x = 120,
        y = 64,
    }
)
```

Install `events.source` to replace the host queue during replay. Pair it with
`tecs.platform.time.provider` to replay event order and frame deltas together. Set the
source to nil to resume the host queue.

## Module contents

### Types

| Type | Kind | Description |
| --- | --- | --- |
| [`Event`](/modules/platform/events/#tecs.platform.events.Event) | <span class="tealdoc-kind-badge tealdoc-kind-record">record</span> | Represents a borrowed platform event routed through the ECS event bus. |
| [`KindTypes`](/modules/platform/events/#tecs.platform.events.KindTypes) | <span class="tealdoc-kind-badge tealdoc-kind-record">record</span> | Maps each event kind to an ECS event type observed at address zero. |

### Functions

| Function | Kind | Description |
| --- | --- | --- |
| [`copy`](/modules/platform/events/#tecs.platform.events.copy) | <span class="tealdoc-kind-badge tealdoc-kind-static">Static</span> | Returns an independent copy, for code that must retain an event past the handler that received it. |
| [`kinds`](/modules/platform/events/#tecs.platform.events.kinds) | <span class="tealdoc-kind-badge tealdoc-kind-static">Static</span> | Returns every kind this build recognizes. |
| [`push`](/modules/platform/events/#tecs.platform.events.push) | <span class="tealdoc-kind-badge tealdoc-kind-static">Static</span> | Pushes a synthetic event onto SDL's own queue. |
| [`source`](/modules/platform/events/#tecs.platform.events.source) | <span class="tealdoc-kind-badge tealdoc-kind-static">Static</span> | Caller-writable. Installs a replay driver in place of the host queue. |
| [`typeOf`](/modules/platform/events/#tecs.platform.events.typeOf) | <span class="tealdoc-kind-badge tealdoc-kind-static">Static</span> | Returns the event type for a kind, or nil for an unknown name. |

### Values

| Value | Type | Description |
| --- | --- | --- |
| [`on`](/modules/platform/events/#tecs.platform.events.on) | [`KindTypes`](/modules/platform/events/#tecs.platform.events.KindTypes) | Read-only. Exposes one ECS event type per kind, to observe at address zero. |

## Types

<a id="tecs.platform.events.Event"></a>
### tecs.platform.events.Event <span class="tealdoc-kind-badge tealdoc-kind-record">record</span>

Represents a borrowed platform event routed through the ECS event bus.
Read-only. Exposes the `Event` type,
discriminated by `kind`. The converter reuses the record passed to a
handler, so anything retaining one takes a copy
through `events.copy`.


```teal
record tecs.platform.events.Event is genericEvents.Event
    kind: string
    timestamp: number
    arrival: number
    scancode: integer
    keycode: integer
    modifiers: integer
    repeated: boolean
    down: boolean
    text: string
    start: integer
    length: integer
    candidates: {string}
    selected: integer
    horizontal: boolean
    x: number
    y: number
    dx: number
    dy: number
    normalX: number
    normalY: number
    button: integer
    clicks: integer
    wheelX: number
    wheelY: number
    wheelTicksX: integer
    wheelTicksY: integer
    flipped: boolean
    scale: number
    axis: integer
    value: number
    pressure: number
    eraser: boolean
    penState: integer
    which: number
    synthetic: boolean
    finger: string
    touchDevice: string
    touchpad: integer
    fingerIndex: integer
    sensor: integer
    sensorX: number
    sensorY: number
    sensorZ: number
    sensorData: {number}
    sensorTimestamp: number
    source: string
    mimeTypes: {string}
    owner: boolean
    recording: boolean
    data1: integer
    data2: integer
    sdlType: integer
end
```

#### Interfaces

| Interface |
| --- |
| [`genericEvents.Event`](/modules/events/#tecs.events.Event) |

<a id="tecs.platform.events.Event.kind"></a>
#### tecs.platform.events.Event.kind <span class="tealdoc-kind-badge tealdoc-kind-field">field</span>

Read-only. Reports what happened and determines which other fields
carry meaning.


```teal
tecs.platform.events.Event.kind: string
```

<a id="tecs.platform.events.Event.timestamp"></a>
#### tecs.platform.events.Event.timestamp <span class="tealdoc-kind-badge tealdoc-kind-field">field</span>

Read-only. Reports nanoseconds on the platform event clock. This clock
orders events against each other, not against `time.now`.


```teal
tecs.platform.events.Event.timestamp: number
```

<a id="tecs.platform.events.Event.arrival"></a>
#### tecs.platform.events.Event.arrival <span class="tealdoc-kind-badge tealdoc-kind-field">field</span>

Read-only. Reports monotonic seconds on the clock `time.now` reads,
converted by the host from the event's platform timestamp. Nil for an
event that did not come through the host queue, such as a replayed one.


```teal
tecs.platform.events.Event.arrival: number
```

<a id="tecs.platform.events.Event.scancode"></a>
#### tecs.platform.events.Event.scancode <span class="tealdoc-kind-badge tealdoc-kind-field">field</span>

Read-only. Reports the physical key position, which is what a movement binding wants: WASD
stays in the same place on every layout.


```teal
tecs.platform.events.Event.scancode: integer
```

<a id="tecs.platform.events.Event.keycode"></a>
#### tecs.platform.events.Event.keycode <span class="tealdoc-kind-badge tealdoc-kind-field">field</span>

Read-only. Reports the key the layout produces, which is what a text binding and a prompt
want. The event carries both because neither answers the other's question.


```teal
tecs.platform.events.Event.keycode: integer
```

<a id="tecs.platform.events.Event.modifiers"></a>
#### tecs.platform.events.Event.modifiers <span class="tealdoc-kind-badge tealdoc-kind-field">field</span>

Read-only. Reports modifier keys held when the event occurred as a mask.


```teal
tecs.platform.events.Event.modifiers: integer
```

<a id="tecs.platform.events.Event.repeated"></a>
#### tecs.platform.events.Event.repeated <span class="tealdoc-kind-badge tealdoc-kind-field">field</span>

Read-only. Reports true when the platform repeats a held key rather than reporting a
new press.


```teal
tecs.platform.events.Event.repeated: boolean
```

<a id="tecs.platform.events.Event.down"></a>
#### tecs.platform.events.Event.down <span class="tealdoc-kind-badge tealdoc-kind-field">field</span>

Read-only. Reports whether the button or key went down.


```teal
tecs.platform.events.Event.down: boolean
```

<a id="tecs.platform.events.Event.text"></a>
#### tecs.platform.events.Event.text <span class="tealdoc-kind-badge tealdoc-kind-field">field</span>

Read-only. Contains text committed or composed by an input method, or dropped
onto the window.


```teal
tecs.platform.events.Event.text: string
```

<a id="tecs.platform.events.Event.start"></a>
#### tecs.platform.events.Event.start <span class="tealdoc-kind-badge tealdoc-kind-field">field</span>

Read-only. Reports the cursor position within composing text.


```teal
tecs.platform.events.Event.start: integer
```

<a id="tecs.platform.events.Event.length"></a>
#### tecs.platform.events.Event.length <span class="tealdoc-kind-badge tealdoc-kind-field">field</span>

Read-only. Reports the selection length within composing text.


```teal
tecs.platform.events.Event.length: integer
```

<a id="tecs.platform.events.Event.candidates"></a>
#### tecs.platform.events.Event.candidates <span class="tealdoc-kind-badge tealdoc-kind-field">field</span>

Read-only. Contains candidates an input method offers. It is nil when
the platform offers none.


```teal
tecs.platform.events.Event.candidates: {string}
```

<a id="tecs.platform.events.Event.selected"></a>
#### tecs.platform.events.Event.selected <span class="tealdoc-kind-badge tealdoc-kind-field">field</span>

Read-only. Reports the selected candidate index.


```teal
tecs.platform.events.Event.selected: integer
```

<a id="tecs.platform.events.Event.horizontal"></a>
#### tecs.platform.events.Event.horizontal <span class="tealdoc-kind-badge tealdoc-kind-field">field</span>

Read-only. Reports whether the platform lays its candidates out
horizontally.


```teal
tecs.platform.events.Event.horizontal: boolean
```

<a id="tecs.platform.events.Event.x"></a>
#### tecs.platform.events.Event.x <span class="tealdoc-kind-badge tealdoc-kind-field">field</span>

Read-only. Reports the pointer's x position in window coordinates.


```teal
tecs.platform.events.Event.x: number
```

<a id="tecs.platform.events.Event.y"></a>
#### tecs.platform.events.Event.y <span class="tealdoc-kind-badge tealdoc-kind-field">field</span>

Read-only. Reports the pointer's y position in window coordinates.


```teal
tecs.platform.events.Event.y: number
```

<a id="tecs.platform.events.Event.dx"></a>
#### tecs.platform.events.Event.dx <span class="tealdoc-kind-badge tealdoc-kind-field">field</span>

Read-only. Reports horizontal movement since the previous event of this kind.


```teal
tecs.platform.events.Event.dx: number
```

<a id="tecs.platform.events.Event.dy"></a>
#### tecs.platform.events.Event.dy <span class="tealdoc-kind-badge tealdoc-kind-field">field</span>

Read-only. Reports vertical movement since the previous event of this kind.


```teal
tecs.platform.events.Event.dy: number
```

<a id="tecs.platform.events.Event.normalX"></a>
#### tecs.platform.events.Event.normalX <span class="tealdoc-kind-badge tealdoc-kind-field">field</span>

Read-only. Reports horizontal pointer position as the platform reported
it, in 0..1 across the
window. The platform normalizes touch at source, so the event carries it
unscaled as well as converted: a normalized position survives a resize
and a window coordinate does not.


```teal
tecs.platform.events.Event.normalX: number
```

<a id="tecs.platform.events.Event.normalY"></a>
#### tecs.platform.events.Event.normalY <span class="tealdoc-kind-badge tealdoc-kind-field">field</span>

Read-only. Reports vertical pointer position from 0 to 1 down the
window.


```teal
tecs.platform.events.Event.normalY: number
```

<a id="tecs.platform.events.Event.button"></a>
#### tecs.platform.events.Event.button <span class="tealdoc-kind-badge tealdoc-kind-field">field</span>

Read-only. Reports the mouse, gamepad or pen button.


```teal
tecs.platform.events.Event.button: integer
```

<a id="tecs.platform.events.Event.clicks"></a>
#### tecs.platform.events.Event.clicks <span class="tealdoc-kind-badge tealdoc-kind-field">field</span>

Read-only. Reports the platform's count of quick successive presses for
this button under its own double-click interval. One for a
single click, two for a double, and up from there.


```teal
tecs.platform.events.Event.clicks: integer
```

<a id="tecs.platform.events.Event.wheelX"></a>
#### tecs.platform.events.Event.wheelX <span class="tealdoc-kind-badge tealdoc-kind-field">field</span>

Read-only. Reports horizontal wheel movement, with one meaning whatever the platform is set to:
positive `wheelY` is a scroll away from the player and positive
`wheelX` is a scroll to the right. A platform reporting natural
scrolling sends the opposite pair and flags it, and the conversion
undoes that, so nothing above binds a sign twice.


```teal
tecs.platform.events.Event.wheelX: number
```

<a id="tecs.platform.events.Event.wheelY"></a>
#### tecs.platform.events.Event.wheelY <span class="tealdoc-kind-badge tealdoc-kind-field">field</span>

Read-only. Reports vertical wheel movement under the same sign
convention as `wheelX`.


```teal
tecs.platform.events.Event.wheelY: number
```

<a id="tecs.platform.events.Event.wheelTicksX"></a>
#### tecs.platform.events.Event.wheelTicksX <span class="tealdoc-kind-badge tealdoc-kind-field">field</span>

Read-only. Reports horizontal wheel movement accumulated to whole notches by the platform, on the
same sign convention. What a menu stepping one item per notch reads,
rather than deciding for itself where a fraction of a notch becomes a
step.


```teal
tecs.platform.events.Event.wheelTicksX: integer
```

<a id="tecs.platform.events.Event.wheelTicksY"></a>
#### tecs.platform.events.Event.wheelTicksY <span class="tealdoc-kind-badge tealdoc-kind-field">field</span>

Read-only. Reports vertical whole-notch wheel movement under the same
sign convention as `wheelTicksX`.


```teal
tecs.platform.events.Event.wheelTicksY: integer
```

<a id="tecs.platform.events.Event.flipped"></a>
#### tecs.platform.events.Event.flipped <span class="tealdoc-kind-badge tealdoc-kind-field">field</span>

Read-only. Reports whether the platform marked this wheel event as
flipped for its configured scroll direction. `wheelX` and `wheelY`
remain normalized; a consumer that intentionally follows the user's
scrolling preference can reverse the normalized pair once when this is
true.


```teal
tecs.platform.events.Event.flipped: boolean
```

<a id="tecs.platform.events.Event.scale"></a>
#### tecs.platform.events.Event.scale <span class="tealdoc-kind-badge tealdoc-kind-field">field</span>

Read-only. Reports the zoom factor since the previous pinch event.
Below one is a pinch closed, above one is a pinch opened.


```teal
tecs.platform.events.Event.scale: number
```

<a id="tecs.platform.events.Event.axis"></a>
#### tecs.platform.events.Event.axis <span class="tealdoc-kind-badge tealdoc-kind-field">field</span>

Read-only. Reports the gamepad or pen axis.


```teal
tecs.platform.events.Event.axis: integer
```

<a id="tecs.platform.events.Event.value"></a>
#### tecs.platform.events.Event.value <span class="tealdoc-kind-badge tealdoc-kind-field">field</span>

Read-only. Reports the axis value in -1..1.


```teal
tecs.platform.events.Event.value: number
```

<a id="tecs.platform.events.Event.pressure"></a>
#### tecs.platform.events.Event.pressure <span class="tealdoc-kind-badge tealdoc-kind-field">field</span>

Read-only. Reports finger pressure from 0 to 1 on a touch surface or gamepad
touchpad. A pen reports its pressure as an axis instead, so a pen event
leaves this holding whatever the last touch put there.


```teal
tecs.platform.events.Event.pressure: number
```

<a id="tecs.platform.events.Event.eraser"></a>
#### tecs.platform.events.Event.eraser <span class="tealdoc-kind-badge tealdoc-kind-field">field</span>

Read-only. Reports whether the pen's eraser end is in use.


```teal
tecs.platform.events.Event.eraser: boolean
```

<a id="tecs.platform.events.Event.penState"></a>
#### tecs.platform.events.Event.penState <span class="tealdoc-kind-badge tealdoc-kind-field">field</span>

Read-only. Reports pen state at the instant of the event as a mask:
the tip down, the eraser end in use, whether it is in proximity, and
each barrel button. `eraser` and `down` answer for one stroke; this
answers which barrel button is held right now. The bits are the
platform's `SDL_PEN_INPUT_*` values. Not carried on the proximity
events, which report no state.


```teal
tecs.platform.events.Event.penState: integer
```

<a id="tecs.platform.events.Event.which"></a>
#### tecs.platform.events.Event.which <span class="tealdoc-kind-badge tealdoc-kind-field">field</span>

Read-only. Reports the device that produced the event: a gamepad, a keyboard, a mouse, a pen,
a sensor, a display, or a window. These identifiers are 32 bits and fit
a Lua number exactly.


```teal
tecs.platform.events.Event.which: number
```

<a id="tecs.platform.events.Event.synthetic"></a>
#### tecs.platform.events.Event.synthetic <span class="tealdoc-kind-badge tealdoc-kind-field">field</span>

Read-only. Reports true when the platform produced this mouse event from a touch or a pen
rather than from a mouse. A game that also handles touch would
otherwise act on the same gesture twice.


```teal
tecs.platform.events.Event.synthetic: boolean
```

<a id="tecs.platform.events.Event.finger"></a>
#### tecs.platform.events.Event.finger <span class="tealdoc-kind-badge tealdoc-kind-field">field</span>

Read-only. Reports the touch finger identity as an opaque string. The
64-bit value does not fit a double, so the event carries a string rather
than numbers that might silently round.


```teal
tecs.platform.events.Event.finger: string
```

<a id="tecs.platform.events.Event.touchDevice"></a>
#### tecs.platform.events.Event.touchDevice <span class="tealdoc-kind-badge tealdoc-kind-field">field</span>

Read-only. Reports the touch device identity as an opaque string.


```teal
tecs.platform.events.Event.touchDevice: string
```

<a id="tecs.platform.events.Event.touchpad"></a>
#### tecs.platform.events.Event.touchpad <span class="tealdoc-kind-badge tealdoc-kind-field">field</span>

Read-only. Reports the gamepad touchpad index. Position on the device
identifies a touchpad finger, not a 64-bit id.


```teal
tecs.platform.events.Event.touchpad: integer
```

<a id="tecs.platform.events.Event.fingerIndex"></a>
#### tecs.platform.events.Event.fingerIndex <span class="tealdoc-kind-badge tealdoc-kind-field">field</span>

Read-only. Reports the finger's slot on the gamepad touchpad.


```teal
tecs.platform.events.Event.fingerIndex: integer
```

<a id="tecs.platform.events.Event.sensor"></a>
#### tecs.platform.events.Event.sensor <span class="tealdoc-kind-badge tealdoc-kind-field">field</span>

Read-only. Reports the sensor identity.


```teal
tecs.platform.events.Event.sensor: integer
```

<a id="tecs.platform.events.Event.sensorX"></a>
#### tecs.platform.events.Event.sensorX <span class="tealdoc-kind-badge tealdoc-kind-field">field</span>

Read-only. Reports the first component of the latest sensor reading.


```teal
tecs.platform.events.Event.sensorX: number
```

<a id="tecs.platform.events.Event.sensorY"></a>
#### tecs.platform.events.Event.sensorY <span class="tealdoc-kind-badge tealdoc-kind-field">field</span>

Read-only. Reports the second component of the latest sensor reading.


```teal
tecs.platform.events.Event.sensorY: number
```

<a id="tecs.platform.events.Event.sensorZ"></a>
#### tecs.platform.events.Event.sensorZ <span class="tealdoc-kind-badge tealdoc-kind-field">field</span>

Read-only. Reports the third component of the latest sensor reading.


```teal
tecs.platform.events.Event.sensorZ: number
```

<a id="tecs.platform.events.Event.sensorData"></a>
#### tecs.platform.events.Event.sensorData <span class="tealdoc-kind-badge tealdoc-kind-field">field</span>

Read-only. Contains the latest sensor reading. A gamepad sensor reports
three components; a standalone sensor reports up to six.


```teal
tecs.platform.events.Event.sensorData: {number}
```

<a id="tecs.platform.events.Event.sensorTimestamp"></a>
#### tecs.platform.events.Event.sensorTimestamp <span class="tealdoc-kind-badge tealdoc-kind-field">field</span>

Read-only. Reports when the hardware took the reading, in nanoseconds on the sensor's own
clock. Like `timestamp` it orders readings against each other and
against nothing else, which is what integrating a rotation over them
needs and is all it is for.


```teal
tecs.platform.events.Event.sensorTimestamp: number
```

<a id="tecs.platform.events.Event.source"></a>
#### tecs.platform.events.Event.source <span class="tealdoc-kind-badge tealdoc-kind-field">field</span>

Read-only. Reports where a dropped file or text came from when the
platform supplies a source.


```teal
tecs.platform.events.Event.source: string
```

<a id="tecs.platform.events.Event.mimeTypes"></a>
#### tecs.platform.events.Event.mimeTypes <span class="tealdoc-kind-badge tealdoc-kind-field">field</span>

Read-only. Lists the clipboard formats on offer.


```teal
tecs.platform.events.Event.mimeTypes: {string}
```

<a id="tecs.platform.events.Event.owner"></a>
#### tecs.platform.events.Event.owner <span class="tealdoc-kind-badge tealdoc-kind-field">field</span>

Read-only. Reports whether the clipboard's new contents belong to this
application.


```teal
tecs.platform.events.Event.owner: boolean
```

<a id="tecs.platform.events.Event.recording"></a>
#### tecs.platform.events.Event.recording <span class="tealdoc-kind-badge tealdoc-kind-field">field</span>

Read-only. Reports whether an audio device records input.


```teal
tecs.platform.events.Event.recording: boolean
```

<a id="tecs.platform.events.Event.data1"></a>
#### tecs.platform.events.Event.data1 <span class="tealdoc-kind-badge tealdoc-kind-field">field</span>

Read-only. Reports the first window, display or user payload integer. A user event's
code arrives in `data1`; the two data pointers beside it do not cross,
since a pointer is not a value this vocabulary can carry.


```teal
tecs.platform.events.Event.data1: integer
```

<a id="tecs.platform.events.Event.data2"></a>
#### tecs.platform.events.Event.data2 <span class="tealdoc-kind-badge tealdoc-kind-field">field</span>

Read-only. Reports the second window, display or user payload integer.


```teal
tecs.platform.events.Event.data2: integer
```

<a id="tecs.platform.events.Event.sdlType"></a>
#### tecs.platform.events.Event.sdlType <span class="tealdoc-kind-badge tealdoc-kind-field">field</span>

Engine-owned. Stores the numeric platform event type and is the only
useful field on
`unknown`.
Ordinary game code should ignore this field for known events.


```teal
tecs.platform.events.Event.sdlType: integer
```

<a id="tecs.platform.events.KindTypes"></a>
### tecs.platform.events.KindTypes <span class="tealdoc-kind-badge tealdoc-kind-record">record</span>

Maps each event kind to an ECS event type observed at address zero.

A game asks for the kinds it wants rather than for the stream:
`world:observe(0, events.on.dropFile, handler)` runs `handler` for dropped files
and for nothing else. That is what a type per kind buys over one type
carrying the kind, where every subscriber receives every kind and filters
it back out again.

Written as a record rather than looked up by name, so a misspelled kind is
a compile error on the key instead of an observer that is never called.
`events.typeOf` is the same table for code holding a kind as a string.

The converter reuses the record an observer receives, so the borrow rule is
the one this module states everywhere: read it, or copy it with
`events.copy`, but do not keep it.


```teal
global record tecs.platform.events.KindTypes
    quit: Event
    terminating: Event
    lowMemory: Event
    appWillEnterBackground: Event
    appDidEnterBackground: Event
    appWillEnterForeground: Event
    appDidEnterForeground: Event
    localeChanged: Event
    themeChanged: Event
    displayOrientation: Event
    displayAdded: Event
    displayRemoved: Event
    displayMoved: Event
    displayScaleChanged: Event
    displayDesktopModeChanged: Event
    displayCurrentModeChanged: Event
    displayUsableBoundsChanged: Event
    windowShown: Event
    windowHidden: Event
    windowExposed: Event
    windowMoved: Event
    windowResized: Event
    windowPixelSizeChanged: Event
    windowMinimized: Event
    windowMaximized: Event
    windowRestored: Event
    windowMouseEnter: Event
    windowMouseLeave: Event
    windowFocusGained: Event
    windowFocusLost: Event
    windowCloseRequested: Event
    windowDisplayChanged: Event
    windowDisplayScaleChanged: Event
    windowSafeAreaChanged: Event
    windowOccluded: Event
    windowEnterFullscreen: Event
    windowLeaveFullscreen: Event
    keyDown: Event
    keyUp: Event
    textEditing: Event
    textCandidates: Event
    textInput: Event
    keymapChanged: Event
    keyboardAdded: Event
    keyboardRemoved: Event
    screenKeyboardShown: Event
    screenKeyboardHidden: Event
    mouseMotion: Event
    mouseDown: Event
    mouseUp: Event
    mouseWheel: Event
    mouseAdded: Event
    mouseRemoved: Event
    fingerDown: Event
    fingerUp: Event
    fingerMotion: Event
    fingerCanceled: Event
    pinchBegin: Event
    pinchUpdate: Event
    pinchEnd: Event
    penProximityIn: Event
    penProximityOut: Event
    penDown: Event
    penUp: Event
    penMotion: Event
    penButtonDown: Event
    penButtonUp: Event
    penAxis: Event
    gamepadAdded: Event
    gamepadRemoved: Event
    gamepadRemapped: Event
    gamepadButtonDown: Event
    gamepadButtonUp: Event
    gamepadAxis: Event
    gamepadSensor: Event
    gamepadTouchpadDown: Event
    gamepadTouchpadUp: Event
    gamepadTouchpadMotion: Event
    dropFile: Event
    dropText: Event
    dropBegin: Event
    dropComplete: Event
    dropPosition: Event
    clipboardUpdate: Event
    audioDeviceAdded: Event
    audioDeviceRemoved: Event
    audioDeviceFormatChanged: Event
    sensorUpdate: Event
    user: Event
    unknown: Event
end
```

<a id="tecs.platform.events.KindTypes.quit"></a>
#### tecs.platform.events.KindTypes.quit <span class="tealdoc-kind-badge tealdoc-kind-field">field</span>

Read-only. Exposes the `"quit"` event type for a requested application
shutdown, including a window close, `SIGINT`, or `SIGTERM`.


```teal
tecs.platform.events.KindTypes.quit: Event
```

<a id="tecs.platform.events.KindTypes.terminating"></a>
#### tecs.platform.events.KindTypes.terminating <span class="tealdoc-kind-badge tealdoc-kind-field">field</span>

Read-only. Exposes the `"terminating"` event type.


```teal
tecs.platform.events.KindTypes.terminating: Event
```

<a id="tecs.platform.events.KindTypes.lowMemory"></a>
#### tecs.platform.events.KindTypes.lowMemory <span class="tealdoc-kind-badge tealdoc-kind-field">field</span>

Read-only. Exposes the `"lowMemory"` event type.


```teal
tecs.platform.events.KindTypes.lowMemory: Event
```

<a id="tecs.platform.events.KindTypes.appWillEnterBackground"></a>
#### tecs.platform.events.KindTypes.appWillEnterBackground <span class="tealdoc-kind-badge tealdoc-kind-field">field</span>

Read-only. Exposes the `"appWillEnterBackground"` event type.


```teal
tecs.platform.events.KindTypes.appWillEnterBackground: Event
```

<a id="tecs.platform.events.KindTypes.appDidEnterBackground"></a>
#### tecs.platform.events.KindTypes.appDidEnterBackground <span class="tealdoc-kind-badge tealdoc-kind-field">field</span>

Read-only. Exposes the `"appDidEnterBackground"` event type.


```teal
tecs.platform.events.KindTypes.appDidEnterBackground: Event
```

<a id="tecs.platform.events.KindTypes.appWillEnterForeground"></a>
#### tecs.platform.events.KindTypes.appWillEnterForeground <span class="tealdoc-kind-badge tealdoc-kind-field">field</span>

Read-only. Exposes the `"appWillEnterForeground"` event type.


```teal
tecs.platform.events.KindTypes.appWillEnterForeground: Event
```

<a id="tecs.platform.events.KindTypes.appDidEnterForeground"></a>
#### tecs.platform.events.KindTypes.appDidEnterForeground <span class="tealdoc-kind-badge tealdoc-kind-field">field</span>

Read-only. Exposes the `"appDidEnterForeground"` event type.


```teal
tecs.platform.events.KindTypes.appDidEnterForeground: Event
```

<a id="tecs.platform.events.KindTypes.localeChanged"></a>
#### tecs.platform.events.KindTypes.localeChanged <span class="tealdoc-kind-badge tealdoc-kind-field">field</span>

Read-only. Exposes the `"localeChanged"` event type.


```teal
tecs.platform.events.KindTypes.localeChanged: Event
```

<a id="tecs.platform.events.KindTypes.themeChanged"></a>
#### tecs.platform.events.KindTypes.themeChanged <span class="tealdoc-kind-badge tealdoc-kind-field">field</span>

Read-only. Exposes the `"themeChanged"` event type.


```teal
tecs.platform.events.KindTypes.themeChanged: Event
```

<a id="tecs.platform.events.KindTypes.displayOrientation"></a>
#### tecs.platform.events.KindTypes.displayOrientation <span class="tealdoc-kind-badge tealdoc-kind-field">field</span>

Read-only. Exposes the `"displayOrientation"` event type.


```teal
tecs.platform.events.KindTypes.displayOrientation: Event
```

<a id="tecs.platform.events.KindTypes.displayAdded"></a>
#### tecs.platform.events.KindTypes.displayAdded <span class="tealdoc-kind-badge tealdoc-kind-field">field</span>

Read-only. Exposes the `"displayAdded"` event type.


```teal
tecs.platform.events.KindTypes.displayAdded: Event
```

<a id="tecs.platform.events.KindTypes.displayRemoved"></a>
#### tecs.platform.events.KindTypes.displayRemoved <span class="tealdoc-kind-badge tealdoc-kind-field">field</span>

Read-only. Exposes the `"displayRemoved"` event type.


```teal
tecs.platform.events.KindTypes.displayRemoved: Event
```

<a id="tecs.platform.events.KindTypes.displayMoved"></a>
#### tecs.platform.events.KindTypes.displayMoved <span class="tealdoc-kind-badge tealdoc-kind-field">field</span>

Read-only. Exposes the `"displayMoved"` event type.


```teal
tecs.platform.events.KindTypes.displayMoved: Event
```

<a id="tecs.platform.events.KindTypes.displayScaleChanged"></a>
#### tecs.platform.events.KindTypes.displayScaleChanged <span class="tealdoc-kind-badge tealdoc-kind-field">field</span>

Read-only. Exposes the `"displayScaleChanged"` event type.


```teal
tecs.platform.events.KindTypes.displayScaleChanged: Event
```

<a id="tecs.platform.events.KindTypes.displayDesktopModeChanged"></a>
#### tecs.platform.events.KindTypes.displayDesktopModeChanged <span class="tealdoc-kind-badge tealdoc-kind-field">field</span>

Read-only. Exposes the `"displayDesktopModeChanged"` event type.


```teal
tecs.platform.events.KindTypes.displayDesktopModeChanged: Event
```

<a id="tecs.platform.events.KindTypes.displayCurrentModeChanged"></a>
#### tecs.platform.events.KindTypes.displayCurrentModeChanged <span class="tealdoc-kind-badge tealdoc-kind-field">field</span>

Read-only. Exposes the `"displayCurrentModeChanged"` event type.


```teal
tecs.platform.events.KindTypes.displayCurrentModeChanged: Event
```

<a id="tecs.platform.events.KindTypes.displayUsableBoundsChanged"></a>
#### tecs.platform.events.KindTypes.displayUsableBoundsChanged <span class="tealdoc-kind-badge tealdoc-kind-field">field</span>

Read-only. Exposes the `"displayUsableBoundsChanged"` event type.


```teal
tecs.platform.events.KindTypes.displayUsableBoundsChanged: Event
```

<a id="tecs.platform.events.KindTypes.windowShown"></a>
#### tecs.platform.events.KindTypes.windowShown <span class="tealdoc-kind-badge tealdoc-kind-field">field</span>

Read-only. Exposes the `"windowShown"` event type.


```teal
tecs.platform.events.KindTypes.windowShown: Event
```

<a id="tecs.platform.events.KindTypes.windowHidden"></a>
#### tecs.platform.events.KindTypes.windowHidden <span class="tealdoc-kind-badge tealdoc-kind-field">field</span>

Read-only. Exposes the `"windowHidden"` event type.


```teal
tecs.platform.events.KindTypes.windowHidden: Event
```

<a id="tecs.platform.events.KindTypes.windowExposed"></a>
#### tecs.platform.events.KindTypes.windowExposed <span class="tealdoc-kind-badge tealdoc-kind-field">field</span>

Read-only. Exposes the `"windowExposed"` event type.


```teal
tecs.platform.events.KindTypes.windowExposed: Event
```

<a id="tecs.platform.events.KindTypes.windowMoved"></a>
#### tecs.platform.events.KindTypes.windowMoved <span class="tealdoc-kind-badge tealdoc-kind-field">field</span>

Read-only. Exposes the `"windowMoved"` event type.


```teal
tecs.platform.events.KindTypes.windowMoved: Event
```

<a id="tecs.platform.events.KindTypes.windowResized"></a>
#### tecs.platform.events.KindTypes.windowResized <span class="tealdoc-kind-badge tealdoc-kind-field">field</span>

Read-only. Exposes the `"windowResized"` event type.


```teal
tecs.platform.events.KindTypes.windowResized: Event
```

<a id="tecs.platform.events.KindTypes.windowPixelSizeChanged"></a>
#### tecs.platform.events.KindTypes.windowPixelSizeChanged <span class="tealdoc-kind-badge tealdoc-kind-field">field</span>

Read-only. Exposes the `"windowPixelSizeChanged"` event type.


```teal
tecs.platform.events.KindTypes.windowPixelSizeChanged: Event
```

<a id="tecs.platform.events.KindTypes.windowMinimized"></a>
#### tecs.platform.events.KindTypes.windowMinimized <span class="tealdoc-kind-badge tealdoc-kind-field">field</span>

Read-only. Exposes the `"windowMinimized"` event type.


```teal
tecs.platform.events.KindTypes.windowMinimized: Event
```

<a id="tecs.platform.events.KindTypes.windowMaximized"></a>
#### tecs.platform.events.KindTypes.windowMaximized <span class="tealdoc-kind-badge tealdoc-kind-field">field</span>

Read-only. Exposes the `"windowMaximized"` event type.


```teal
tecs.platform.events.KindTypes.windowMaximized: Event
```

<a id="tecs.platform.events.KindTypes.windowRestored"></a>
#### tecs.platform.events.KindTypes.windowRestored <span class="tealdoc-kind-badge tealdoc-kind-field">field</span>

Read-only. Exposes the `"windowRestored"` event type.


```teal
tecs.platform.events.KindTypes.windowRestored: Event
```

<a id="tecs.platform.events.KindTypes.windowMouseEnter"></a>
#### tecs.platform.events.KindTypes.windowMouseEnter <span class="tealdoc-kind-badge tealdoc-kind-field">field</span>

Read-only. Exposes the `"windowMouseEnter"` event type.


```teal
tecs.platform.events.KindTypes.windowMouseEnter: Event
```

<a id="tecs.platform.events.KindTypes.windowMouseLeave"></a>
#### tecs.platform.events.KindTypes.windowMouseLeave <span class="tealdoc-kind-badge tealdoc-kind-field">field</span>

Read-only. Exposes the `"windowMouseLeave"` event type.


```teal
tecs.platform.events.KindTypes.windowMouseLeave: Event
```

<a id="tecs.platform.events.KindTypes.windowFocusGained"></a>
#### tecs.platform.events.KindTypes.windowFocusGained <span class="tealdoc-kind-badge tealdoc-kind-field">field</span>

Read-only. Exposes the `"windowFocusGained"` event type.


```teal
tecs.platform.events.KindTypes.windowFocusGained: Event
```

<a id="tecs.platform.events.KindTypes.windowFocusLost"></a>
#### tecs.platform.events.KindTypes.windowFocusLost <span class="tealdoc-kind-badge tealdoc-kind-field">field</span>

Read-only. Exposes the `"windowFocusLost"` event type.


```teal
tecs.platform.events.KindTypes.windowFocusLost: Event
```

<a id="tecs.platform.events.KindTypes.windowCloseRequested"></a>
#### tecs.platform.events.KindTypes.windowCloseRequested <span class="tealdoc-kind-badge tealdoc-kind-field">field</span>

Read-only. Exposes the `"windowCloseRequested"` event type.


```teal
tecs.platform.events.KindTypes.windowCloseRequested: Event
```

<a id="tecs.platform.events.KindTypes.windowDisplayChanged"></a>
#### tecs.platform.events.KindTypes.windowDisplayChanged <span class="tealdoc-kind-badge tealdoc-kind-field">field</span>

Read-only. Exposes the `"windowDisplayChanged"` event type.


```teal
tecs.platform.events.KindTypes.windowDisplayChanged: Event
```

<a id="tecs.platform.events.KindTypes.windowDisplayScaleChanged"></a>
#### tecs.platform.events.KindTypes.windowDisplayScaleChanged <span class="tealdoc-kind-badge tealdoc-kind-field">field</span>

Read-only. Exposes the `"windowDisplayScaleChanged"` event type.


```teal
tecs.platform.events.KindTypes.windowDisplayScaleChanged: Event
```

<a id="tecs.platform.events.KindTypes.windowSafeAreaChanged"></a>
#### tecs.platform.events.KindTypes.windowSafeAreaChanged <span class="tealdoc-kind-badge tealdoc-kind-field">field</span>

Read-only. Exposes the `"windowSafeAreaChanged"` event type.


```teal
tecs.platform.events.KindTypes.windowSafeAreaChanged: Event
```

<a id="tecs.platform.events.KindTypes.windowOccluded"></a>
#### tecs.platform.events.KindTypes.windowOccluded <span class="tealdoc-kind-badge tealdoc-kind-field">field</span>

Read-only. Exposes the `"windowOccluded"` event type.


```teal
tecs.platform.events.KindTypes.windowOccluded: Event
```

<a id="tecs.platform.events.KindTypes.windowEnterFullscreen"></a>
#### tecs.platform.events.KindTypes.windowEnterFullscreen <span class="tealdoc-kind-badge tealdoc-kind-field">field</span>

Read-only. Exposes the `"windowEnterFullscreen"` event type.


```teal
tecs.platform.events.KindTypes.windowEnterFullscreen: Event
```

<a id="tecs.platform.events.KindTypes.windowLeaveFullscreen"></a>
#### tecs.platform.events.KindTypes.windowLeaveFullscreen <span class="tealdoc-kind-badge tealdoc-kind-field">field</span>

Read-only. Exposes the `"windowLeaveFullscreen"` event type.


```teal
tecs.platform.events.KindTypes.windowLeaveFullscreen: Event
```

<a id="tecs.platform.events.KindTypes.keyDown"></a>
#### tecs.platform.events.KindTypes.keyDown <span class="tealdoc-kind-badge tealdoc-kind-field">field</span>

Read-only. Exposes the `"keyDown"` event type.


```teal
tecs.platform.events.KindTypes.keyDown: Event
```

<a id="tecs.platform.events.KindTypes.keyUp"></a>
#### tecs.platform.events.KindTypes.keyUp <span class="tealdoc-kind-badge tealdoc-kind-field">field</span>

Read-only. Exposes the `"keyUp"` event type.


```teal
tecs.platform.events.KindTypes.keyUp: Event
```

<a id="tecs.platform.events.KindTypes.textEditing"></a>
#### tecs.platform.events.KindTypes.textEditing <span class="tealdoc-kind-badge tealdoc-kind-field">field</span>

Read-only. Exposes the `"textEditing"` event type.


```teal
tecs.platform.events.KindTypes.textEditing: Event
```

<a id="tecs.platform.events.KindTypes.textCandidates"></a>
#### tecs.platform.events.KindTypes.textCandidates <span class="tealdoc-kind-badge tealdoc-kind-field">field</span>

Read-only. Exposes the `"textCandidates"` event type.


```teal
tecs.platform.events.KindTypes.textCandidates: Event
```

<a id="tecs.platform.events.KindTypes.textInput"></a>
#### tecs.platform.events.KindTypes.textInput <span class="tealdoc-kind-badge tealdoc-kind-field">field</span>

Read-only. Exposes the `"textInput"` event type.


```teal
tecs.platform.events.KindTypes.textInput: Event
```

<a id="tecs.platform.events.KindTypes.keymapChanged"></a>
#### tecs.platform.events.KindTypes.keymapChanged <span class="tealdoc-kind-badge tealdoc-kind-field">field</span>

Read-only. Exposes the `"keymapChanged"` event type.


```teal
tecs.platform.events.KindTypes.keymapChanged: Event
```

<a id="tecs.platform.events.KindTypes.keyboardAdded"></a>
#### tecs.platform.events.KindTypes.keyboardAdded <span class="tealdoc-kind-badge tealdoc-kind-field">field</span>

Read-only. Exposes the `"keyboardAdded"` event type.


```teal
tecs.platform.events.KindTypes.keyboardAdded: Event
```

<a id="tecs.platform.events.KindTypes.keyboardRemoved"></a>
#### tecs.platform.events.KindTypes.keyboardRemoved <span class="tealdoc-kind-badge tealdoc-kind-field">field</span>

Read-only. Exposes the `"keyboardRemoved"` event type.


```teal
tecs.platform.events.KindTypes.keyboardRemoved: Event
```

<a id="tecs.platform.events.KindTypes.screenKeyboardShown"></a>
#### tecs.platform.events.KindTypes.screenKeyboardShown <span class="tealdoc-kind-badge tealdoc-kind-field">field</span>

Read-only. Exposes the `"screenKeyboardShown"` event type.


```teal
tecs.platform.events.KindTypes.screenKeyboardShown: Event
```

<a id="tecs.platform.events.KindTypes.screenKeyboardHidden"></a>
#### tecs.platform.events.KindTypes.screenKeyboardHidden <span class="tealdoc-kind-badge tealdoc-kind-field">field</span>

Read-only. Exposes the `"screenKeyboardHidden"` event type.


```teal
tecs.platform.events.KindTypes.screenKeyboardHidden: Event
```

<a id="tecs.platform.events.KindTypes.mouseMotion"></a>
#### tecs.platform.events.KindTypes.mouseMotion <span class="tealdoc-kind-badge tealdoc-kind-field">field</span>

Read-only. Exposes the `"mouseMotion"` event type.


```teal
tecs.platform.events.KindTypes.mouseMotion: Event
```

<a id="tecs.platform.events.KindTypes.mouseDown"></a>
#### tecs.platform.events.KindTypes.mouseDown <span class="tealdoc-kind-badge tealdoc-kind-field">field</span>

Read-only. Exposes the `"mouseDown"` event type.


```teal
tecs.platform.events.KindTypes.mouseDown: Event
```

<a id="tecs.platform.events.KindTypes.mouseUp"></a>
#### tecs.platform.events.KindTypes.mouseUp <span class="tealdoc-kind-badge tealdoc-kind-field">field</span>

Read-only. Exposes the `"mouseUp"` event type.


```teal
tecs.platform.events.KindTypes.mouseUp: Event
```

<a id="tecs.platform.events.KindTypes.mouseWheel"></a>
#### tecs.platform.events.KindTypes.mouseWheel <span class="tealdoc-kind-badge tealdoc-kind-field">field</span>

Read-only. Exposes the `"mouseWheel"` event type.


```teal
tecs.platform.events.KindTypes.mouseWheel: Event
```

<a id="tecs.platform.events.KindTypes.mouseAdded"></a>
#### tecs.platform.events.KindTypes.mouseAdded <span class="tealdoc-kind-badge tealdoc-kind-field">field</span>

Read-only. Exposes the `"mouseAdded"` event type.


```teal
tecs.platform.events.KindTypes.mouseAdded: Event
```

<a id="tecs.platform.events.KindTypes.mouseRemoved"></a>
#### tecs.platform.events.KindTypes.mouseRemoved <span class="tealdoc-kind-badge tealdoc-kind-field">field</span>

Read-only. Exposes the `"mouseRemoved"` event type.


```teal
tecs.platform.events.KindTypes.mouseRemoved: Event
```

<a id="tecs.platform.events.KindTypes.fingerDown"></a>
#### tecs.platform.events.KindTypes.fingerDown <span class="tealdoc-kind-badge tealdoc-kind-field">field</span>

Read-only. Exposes the `"fingerDown"` event type.


```teal
tecs.platform.events.KindTypes.fingerDown: Event
```

<a id="tecs.platform.events.KindTypes.fingerUp"></a>
#### tecs.platform.events.KindTypes.fingerUp <span class="tealdoc-kind-badge tealdoc-kind-field">field</span>

Read-only. Exposes the `"fingerUp"` event type.


```teal
tecs.platform.events.KindTypes.fingerUp: Event
```

<a id="tecs.platform.events.KindTypes.fingerMotion"></a>
#### tecs.platform.events.KindTypes.fingerMotion <span class="tealdoc-kind-badge tealdoc-kind-field">field</span>

Read-only. Exposes the `"fingerMotion"` event type.


```teal
tecs.platform.events.KindTypes.fingerMotion: Event
```

<a id="tecs.platform.events.KindTypes.fingerCanceled"></a>
#### tecs.platform.events.KindTypes.fingerCanceled <span class="tealdoc-kind-badge tealdoc-kind-field">field</span>

Read-only. Exposes the `"fingerCanceled"` event type.


```teal
tecs.platform.events.KindTypes.fingerCanceled: Event
```

<a id="tecs.platform.events.KindTypes.pinchBegin"></a>
#### tecs.platform.events.KindTypes.pinchBegin <span class="tealdoc-kind-badge tealdoc-kind-field">field</span>

Read-only. Exposes the `"pinchBegin"` event type.


```teal
tecs.platform.events.KindTypes.pinchBegin: Event
```

<a id="tecs.platform.events.KindTypes.pinchUpdate"></a>
#### tecs.platform.events.KindTypes.pinchUpdate <span class="tealdoc-kind-badge tealdoc-kind-field">field</span>

Read-only. Exposes the `"pinchUpdate"` event type.


```teal
tecs.platform.events.KindTypes.pinchUpdate: Event
```

<a id="tecs.platform.events.KindTypes.pinchEnd"></a>
#### tecs.platform.events.KindTypes.pinchEnd <span class="tealdoc-kind-badge tealdoc-kind-field">field</span>

Read-only. Exposes the `"pinchEnd"` event type.


```teal
tecs.platform.events.KindTypes.pinchEnd: Event
```

<a id="tecs.platform.events.KindTypes.penProximityIn"></a>
#### tecs.platform.events.KindTypes.penProximityIn <span class="tealdoc-kind-badge tealdoc-kind-field">field</span>

Read-only. Exposes the `"penProximityIn"` event type.


```teal
tecs.platform.events.KindTypes.penProximityIn: Event
```

<a id="tecs.platform.events.KindTypes.penProximityOut"></a>
#### tecs.platform.events.KindTypes.penProximityOut <span class="tealdoc-kind-badge tealdoc-kind-field">field</span>

Read-only. Exposes the `"penProximityOut"` event type.


```teal
tecs.platform.events.KindTypes.penProximityOut: Event
```

<a id="tecs.platform.events.KindTypes.penDown"></a>
#### tecs.platform.events.KindTypes.penDown <span class="tealdoc-kind-badge tealdoc-kind-field">field</span>

Read-only. Exposes the `"penDown"` event type.


```teal
tecs.platform.events.KindTypes.penDown: Event
```

<a id="tecs.platform.events.KindTypes.penUp"></a>
#### tecs.platform.events.KindTypes.penUp <span class="tealdoc-kind-badge tealdoc-kind-field">field</span>

Read-only. Exposes the `"penUp"` event type.


```teal
tecs.platform.events.KindTypes.penUp: Event
```

<a id="tecs.platform.events.KindTypes.penMotion"></a>
#### tecs.platform.events.KindTypes.penMotion <span class="tealdoc-kind-badge tealdoc-kind-field">field</span>

Read-only. Exposes the `"penMotion"` event type.


```teal
tecs.platform.events.KindTypes.penMotion: Event
```

<a id="tecs.platform.events.KindTypes.penButtonDown"></a>
#### tecs.platform.events.KindTypes.penButtonDown <span class="tealdoc-kind-badge tealdoc-kind-field">field</span>

Read-only. Exposes the `"penButtonDown"` event type.


```teal
tecs.platform.events.KindTypes.penButtonDown: Event
```

<a id="tecs.platform.events.KindTypes.penButtonUp"></a>
#### tecs.platform.events.KindTypes.penButtonUp <span class="tealdoc-kind-badge tealdoc-kind-field">field</span>

Read-only. Exposes the `"penButtonUp"` event type.


```teal
tecs.platform.events.KindTypes.penButtonUp: Event
```

<a id="tecs.platform.events.KindTypes.penAxis"></a>
#### tecs.platform.events.KindTypes.penAxis <span class="tealdoc-kind-badge tealdoc-kind-field">field</span>

Read-only. Exposes the `"penAxis"` event type.


```teal
tecs.platform.events.KindTypes.penAxis: Event
```

<a id="tecs.platform.events.KindTypes.gamepadAdded"></a>
#### tecs.platform.events.KindTypes.gamepadAdded <span class="tealdoc-kind-badge tealdoc-kind-field">field</span>

Read-only. Exposes the `"gamepadAdded"` event type.


```teal
tecs.platform.events.KindTypes.gamepadAdded: Event
```

<a id="tecs.platform.events.KindTypes.gamepadRemoved"></a>
#### tecs.platform.events.KindTypes.gamepadRemoved <span class="tealdoc-kind-badge tealdoc-kind-field">field</span>

Read-only. Exposes the `"gamepadRemoved"` event type.


```teal
tecs.platform.events.KindTypes.gamepadRemoved: Event
```

<a id="tecs.platform.events.KindTypes.gamepadRemapped"></a>
#### tecs.platform.events.KindTypes.gamepadRemapped <span class="tealdoc-kind-badge tealdoc-kind-field">field</span>

Read-only. Exposes the `"gamepadRemapped"` event type.


```teal
tecs.platform.events.KindTypes.gamepadRemapped: Event
```

<a id="tecs.platform.events.KindTypes.gamepadButtonDown"></a>
#### tecs.platform.events.KindTypes.gamepadButtonDown <span class="tealdoc-kind-badge tealdoc-kind-field">field</span>

Read-only. Exposes the `"gamepadButtonDown"` event type.


```teal
tecs.platform.events.KindTypes.gamepadButtonDown: Event
```

<a id="tecs.platform.events.KindTypes.gamepadButtonUp"></a>
#### tecs.platform.events.KindTypes.gamepadButtonUp <span class="tealdoc-kind-badge tealdoc-kind-field">field</span>

Read-only. Exposes the `"gamepadButtonUp"` event type.


```teal
tecs.platform.events.KindTypes.gamepadButtonUp: Event
```

<a id="tecs.platform.events.KindTypes.gamepadAxis"></a>
#### tecs.platform.events.KindTypes.gamepadAxis <span class="tealdoc-kind-badge tealdoc-kind-field">field</span>

Read-only. Exposes the `"gamepadAxis"` event type.


```teal
tecs.platform.events.KindTypes.gamepadAxis: Event
```

<a id="tecs.platform.events.KindTypes.gamepadSensor"></a>
#### tecs.platform.events.KindTypes.gamepadSensor <span class="tealdoc-kind-badge tealdoc-kind-field">field</span>

Read-only. Exposes the `"gamepadSensor"` event type.


```teal
tecs.platform.events.KindTypes.gamepadSensor: Event
```

<a id="tecs.platform.events.KindTypes.gamepadTouchpadDown"></a>
#### tecs.platform.events.KindTypes.gamepadTouchpadDown <span class="tealdoc-kind-badge tealdoc-kind-field">field</span>

Read-only. Exposes the `"gamepadTouchpadDown"` event type.


```teal
tecs.platform.events.KindTypes.gamepadTouchpadDown: Event
```

<a id="tecs.platform.events.KindTypes.gamepadTouchpadUp"></a>
#### tecs.platform.events.KindTypes.gamepadTouchpadUp <span class="tealdoc-kind-badge tealdoc-kind-field">field</span>

Read-only. Exposes the `"gamepadTouchpadUp"` event type.


```teal
tecs.platform.events.KindTypes.gamepadTouchpadUp: Event
```

<a id="tecs.platform.events.KindTypes.gamepadTouchpadMotion"></a>
#### tecs.platform.events.KindTypes.gamepadTouchpadMotion <span class="tealdoc-kind-badge tealdoc-kind-field">field</span>

Read-only. Exposes the `"gamepadTouchpadMotion"` event type.


```teal
tecs.platform.events.KindTypes.gamepadTouchpadMotion: Event
```

<a id="tecs.platform.events.KindTypes.dropFile"></a>
#### tecs.platform.events.KindTypes.dropFile <span class="tealdoc-kind-badge tealdoc-kind-field">field</span>

Read-only. Exposes the `"dropFile"` event type.


```teal
tecs.platform.events.KindTypes.dropFile: Event
```

<a id="tecs.platform.events.KindTypes.dropText"></a>
#### tecs.platform.events.KindTypes.dropText <span class="tealdoc-kind-badge tealdoc-kind-field">field</span>

Read-only. Exposes the `"dropText"` event type.


```teal
tecs.platform.events.KindTypes.dropText: Event
```

<a id="tecs.platform.events.KindTypes.dropBegin"></a>
#### tecs.platform.events.KindTypes.dropBegin <span class="tealdoc-kind-badge tealdoc-kind-field">field</span>

Read-only. Exposes the `"dropBegin"` event type.


```teal
tecs.platform.events.KindTypes.dropBegin: Event
```

<a id="tecs.platform.events.KindTypes.dropComplete"></a>
#### tecs.platform.events.KindTypes.dropComplete <span class="tealdoc-kind-badge tealdoc-kind-field">field</span>

Read-only. Exposes the `"dropComplete"` event type.


```teal
tecs.platform.events.KindTypes.dropComplete: Event
```

<a id="tecs.platform.events.KindTypes.dropPosition"></a>
#### tecs.platform.events.KindTypes.dropPosition <span class="tealdoc-kind-badge tealdoc-kind-field">field</span>

Read-only. Exposes the `"dropPosition"` event type.


```teal
tecs.platform.events.KindTypes.dropPosition: Event
```

<a id="tecs.platform.events.KindTypes.clipboardUpdate"></a>
#### tecs.platform.events.KindTypes.clipboardUpdate <span class="tealdoc-kind-badge tealdoc-kind-field">field</span>

Read-only. Exposes the `"clipboardUpdate"` event type.


```teal
tecs.platform.events.KindTypes.clipboardUpdate: Event
```

<a id="tecs.platform.events.KindTypes.audioDeviceAdded"></a>
#### tecs.platform.events.KindTypes.audioDeviceAdded <span class="tealdoc-kind-badge tealdoc-kind-field">field</span>

Read-only. Exposes the `"audioDeviceAdded"` event type.


```teal
tecs.platform.events.KindTypes.audioDeviceAdded: Event
```

<a id="tecs.platform.events.KindTypes.audioDeviceRemoved"></a>
#### tecs.platform.events.KindTypes.audioDeviceRemoved <span class="tealdoc-kind-badge tealdoc-kind-field">field</span>

Read-only. Exposes the `"audioDeviceRemoved"` event type.


```teal
tecs.platform.events.KindTypes.audioDeviceRemoved: Event
```

<a id="tecs.platform.events.KindTypes.audioDeviceFormatChanged"></a>
#### tecs.platform.events.KindTypes.audioDeviceFormatChanged <span class="tealdoc-kind-badge tealdoc-kind-field">field</span>

Read-only. Exposes the `"audioDeviceFormatChanged"` event type.


```teal
tecs.platform.events.KindTypes.audioDeviceFormatChanged: Event
```

<a id="tecs.platform.events.KindTypes.sensorUpdate"></a>
#### tecs.platform.events.KindTypes.sensorUpdate <span class="tealdoc-kind-badge tealdoc-kind-field">field</span>

Read-only. Exposes the `"sensorUpdate"` event type.


```teal
tecs.platform.events.KindTypes.sensorUpdate: Event
```

<a id="tecs.platform.events.KindTypes.user"></a>
#### tecs.platform.events.KindTypes.user <span class="tealdoc-kind-badge tealdoc-kind-field">field</span>

Read-only. Exposes the `"user"` event type.


```teal
tecs.platform.events.KindTypes.user: Event
```

<a id="tecs.platform.events.KindTypes.unknown"></a>
#### tecs.platform.events.KindTypes.unknown <span class="tealdoc-kind-badge tealdoc-kind-field">field</span>

Read-only. Selects an event kind this build has no name for. Such an
event carries `sdlType` and nothing else worth reading.


```teal
tecs.platform.events.KindTypes.unknown: Event
```

## Functions

<a id="tecs.platform.events.copy"></a>
### tecs.platform.events.copy <span class="tealdoc-kind-badge tealdoc-kind-static">Static</span>

Returns an independent copy, for code that must retain an event past the
handler that received it.

Shallow, which is enough because every field is a number, a string or a
boolean except the three lists, and those are freshly built per event
rather than reused. Allocates, so this is for the events a recorder or a
tool keeps and not for the stream.



```teal
function tecs.platform.events.copy(event: Event): Event
```

#### Arguments

| Name | Type | Description |
| --- | --- | --- |
| `event` | [`Event`](/modules/platform/events/#tecs.platform.events.Event) | The borrowed event to copy. |

#### Returns

| Type | Description |
| --- | --- |
| [`Event`](/modules/platform/events/#tecs.platform.events.Event) | A new event record that the caller can retain. |

<a id="tecs.platform.events.kinds"></a>
### tecs.platform.events.kinds <span class="tealdoc-kind-badge tealdoc-kind-static">Static</span>

Returns every kind this build recognizes.


```teal
function tecs.platform.events.kinds(): {string}
```

#### Arguments

None.

#### Returns

| Type | Description |
| --- | --- |
| `{string}` |  |

<a id="tecs.platform.events.push"></a>
### tecs.platform.events.push <span class="tealdoc-kind-badge tealdoc-kind-static">Static</span>

Pushes a synthetic event onto SDL's own queue.

Takes the engine's vocabulary rather than an SDL union, so a test or a tool
can inject input without knowing SDL's layout. Only the fields a kind uses
are read.

This function fills payloads for the key, mouse, wheel, pen, gamepad, device, pinch,
window and display kinds. It pushes any other recognized kind with its
type and nothing else, which is what a kind whose payload nobody injects
needs and is not what a caller expecting a full event would assume.

The function writes a wheel payload the way the platform does, so `flipped`
sets the direction and the axes beside it are left as given. The conversion
then negates them, which is what a caller asking for a flipped scroll is
asking to see: the round trip is the normalization, not the identity.

The platform stamps the timestamp, so a pushed event arrives ordered against real
ones rather than ahead of them.


```teal
function tecs.platform.events.push(kind: string, fields: Event)
```

#### Arguments

| Name | Type | Description |
| --- | --- | --- |
| `kind` | `string` | One of `events.kinds()`. An unrecognized name raises. |
| `fields` | [`Event`](/modules/platform/events/#tecs.platform.events.Event) |  |

#### Returns

None.

<a id="tecs.platform.events.source"></a>
### tecs.platform.events.source <span class="tealdoc-kind-badge tealdoc-kind-static">Static</span>

Caller-writable. Installs a replay driver in place of the host queue.
The driver invokes the handler for each recorded event.


```teal
function tecs.platform.events.source(handler: function(Event))
```

#### Arguments

| Name | Type | Description |
| --- | --- | --- |
| `handler` | `function(`[`Event`](/modules/platform/events/#tecs.platform.events.Event)`)` | Receives each event the replay source supplies. |

#### Returns

None.

<a id="tecs.platform.events.typeOf"></a>
### tecs.platform.events.typeOf <span class="tealdoc-kind-badge tealdoc-kind-static">Static</span>

Returns the event type for a kind, or nil for an unknown name.

What `on` is for code holding a kind it cannot spell in source, which
is the conversion itself and the debug tools.



```teal
function tecs.platform.events.typeOf(kind: string): Event
```

#### Arguments

| Name | Type | Description |
| --- | --- | --- |
| `kind` | `string` | A kind name as `on` spells it. Names are this build's, so a kind SDL added later is unknown here rather than an error. |

#### Returns

| Type | Description |
| --- | --- |
| [`Event`](/modules/platform/events/#tecs.platform.events.Event) | The event type to observe, or nil for a name this build does not carry. |

## Values

<a id="tecs.platform.events.on"></a>
### tecs.platform.events.on <span class="tealdoc-kind-badge tealdoc-kind-variable">variable</span>

Read-only. Exposes one ECS event type per kind, to observe at address
zero. See `events.on`.


```teal
tecs.platform.events.on: KindTypes
```