Files
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.
| Parameter | Type | Default | Description |
|---|
state | dynamic | — | Mutable state inspected or updated by the operation. |
name | dynamic | — | 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.
| Parameter | Type | Default | Description |
|---|
state | dynamic | — | Mutable state inspected or updated by the operation. |
name | dynamic | — | Name of the affected item. |
frameMsec | dynamic | — | frameMsec value consumed by this operation. |
consume | dynamic | — | consume value consumed by this operation. |
View source
# addMouseDelta
function addMouseDelta(state, dx, dy)
Add mouse delta.
| Parameter | Type | Default | Description |
|---|
state | dynamic | — | Mutable state inspected or updated by the operation. |
dx | dynamic | — | dx value consumed by this operation. |
dy | dynamic | — | dy value consumed by this operation. |
View source
# angleShort
function angleShort(value)
Return the angle short value.
| Parameter | Type | Default | Description |
|---|
value | dynamic | — | 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.
| Parameter | Type | Default | Description |
|---|
state | dynamic | — | Mutable state inspected or updated by the operation. |
frameMsec | dynamic | — | frameMsec value consumed by this operation. |
consumeTransient | dynamic | — | consumeTransient value consumed by this operation. |
View source
# clampCommandMsec
inline function clampCommandMsec(frameMsec)
Clamp command msec.
| Parameter | Type | Default | Description |
|---|
frameMsec | dynamic | — | frameMsec value consumed by this operation. |
View source
# clampPitch
function clampPitch(state)
Clamp pitch.
| Parameter | Type | Default | Description |
|---|
state | dynamic | — | Mutable state inspected or updated by the operation. |
View source
# createSampledUserCmd
function createSampledUserCmd(state, frameMsec)
Create sampled user cmd.
| Parameter | Type | Default | Description |
|---|
state | dynamic | — | Mutable state inspected or updated by the operation. |
frameMsec | dynamic | — | frameMsec value consumed by this operation. |
View source
# createUserCmd
function createUserCmd(state, frameMsec)
Create user cmd.
| Parameter | Type | Default | Description |
|---|
state | dynamic | — | Mutable state inspected or updated by the operation. |
frameMsec | dynamic | — | frameMsec value consumed by this operation. |
View source
# previewUserCmd
function previewUserCmd(state, frameMsec)
Return the preview user cmd value.
| Parameter | Type | Default | Description |
|---|
state | dynamic | — | Mutable state inspected or updated by the operation. |
frameMsec | dynamic | — | 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.
| Parameter | Type | Default | Description |
|---|
state | dynamic | — | Mutable state inspected or updated by the operation. |
frameMsec | dynamic | — | frameMsec value consumed by this operation. |
View source
# setImpulse
function setImpulse(state, value)
Set impulse.
| Parameter | Type | Default | Description |
|---|
state | dynamic | — | Mutable state inspected or updated by the operation. |
value | dynamic | — | Value consumed or transformed by the operation. |
View source