MiniQuake2

src/miniquake2/client/ui/input.ml

Provides miniquake2 client ui input facilities for this project.

Package
miniquake2.client.ui.input
Reachable
Yes

Imports

Declarations

action

function action(state, name)

Performs the action operation for the miniquake2 client ui input module.

ParameterTypeDefaultDescription
statedynamic—Mutable state inspected or updated by the operation.
namedynamic—Name of the affected item.

View source

actionFraction

function actionFraction(state, name, frameMsec, consume)

Return the fraction of this command interval for which an action was held. Key-up events contribute their exact timestamped duration; a still-held key contributes from its last down time through the command endpoint.

ParameterTypeDefaultDescription
statedynamic—Mutable state inspected or updated by the operation.
namedynamic—Name of the affected item.
frameMsecdynamic—frameMsec value consumed by this operation.
consumedynamic—consume value consumed by this operation.

View source

addMouseDelta

function addMouseDelta(state, dx, dy)

Add mouse delta.

ParameterTypeDefaultDescription
statedynamic—Mutable state inspected or updated by the operation.
dxdynamic—dx value consumed by this operation.
dydynamic—dy value consumed by this operation.

View source

angleShort

function angleShort(value)

Return the angle short value.

ParameterTypeDefaultDescription
valuedynamic—Value consumed or transformed by the operation.

View source

buildSampledUserCmd

function buildSampledUserCmd(state, frameMsec, consumeTransient)

Construct a command after sampleView has already consumed this render frame's look input. consumeTransient=false is the side-effect-free preview used by client prediction between network ticks.

ParameterTypeDefaultDescription
statedynamic—Mutable state inspected or updated by the operation.
frameMsecdynamic—frameMsec value consumed by this operation.
consumeTransientdynamic—consumeTransient value consumed by this operation.

View source

clampCommandMsec

inline function clampCommandMsec(frameMsec)

Clamp command msec.

ParameterTypeDefaultDescription
frameMsecdynamic—frameMsec value consumed by this operation.

View source

clampPitch

function clampPitch(state)

Clamp pitch.

ParameterTypeDefaultDescription
statedynamic—Mutable state inspected or updated by the operation.

View source

createSampledUserCmd

function createSampledUserCmd(state, frameMsec)

Create sampled user cmd.

ParameterTypeDefaultDescription
statedynamic—Mutable state inspected or updated by the operation.
frameMsecdynamic—frameMsec value consumed by this operation.

View source

createUserCmd

function createUserCmd(state, frameMsec)

Create user cmd.

ParameterTypeDefaultDescription
statedynamic—Mutable state inspected or updated by the operation.
frameMsecdynamic—frameMsec value consumed by this operation.

View source

previewUserCmd

function previewUserCmd(state, frameMsec)

Return the preview user cmd value.

ParameterTypeDefaultDescription
statedynamic—Mutable state inspected or updated by the operation.
frameMsecdynamic—frameMsec value consumed by this operation.

View source

sampleView

function sampleView(state, frameMsec)

Apply view changes independently from the network command cadence. The product samples this once per rendered frame, matching Quake II's CL_AdjustAngles/IN_Move split and removing the former 100 ms mouse-look lag. Mouse axes routed to strafe/klook deliberately remain accumulated until the next UserCmd because those axes are movement rather than view input.

ParameterTypeDefaultDescription
statedynamic—Mutable state inspected or updated by the operation.
frameMsecdynamic—frameMsec value consumed by this operation.

View source

setImpulse

function setImpulse(state, value)

Set impulse.

ParameterTypeDefaultDescription
statedynamic—Mutable state inspected or updated by the operation.
valuedynamic—Value consumed or transformed by the operation.

View source