API Reference › Input › Input.replay
method

Input.replay

Input.replay() -> void

Rewinds the recording made by Input.record and switches to replay mode: each subsequent Input.poll returns the next key from the tape instead of the live device, so the recorded session runs again exactly — deterministic replays, demo playback, and the basis of rollback netcode. Past the end of the tape, poll reports no input.

Example

program Replaying {
  entry {
    Input.bind("up", 'w')
    Input.record()
    Input.poll()
    Input.replay()
    Input.poll()
    if Input.down("up") { print(1) }
  }
}
← All symbols