{"record":{"id":"262e3db5594925e2","repo":"moeru-ai/airi","slug":"the-gamepad-deadzone-must-be-from-0-to-less-than-1","errorCode":null,"errorMessage":"The gamepad deadzone must be from 0 to less than 1.","messagePattern":"The gamepad deadzone must be from 0 to less than 1\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/input-gamepad/src/standard-gamepad.ts","lineNumber":123,"sourceCode":"  const deadzone = options?.deadzone ?? 0.12\n  if (!Number.isFinite(deadzone) || deadzone < 0 || deadzone >= 1)\n    throw new Error('The gamepad deadzone must be from 0 to less than 1.')\n\n  return {\n    buttons: createButtonStates(gamepad.buttons),\n    family: detectGamepadFamily(gamepad.id),\n    id: gamepad.id,\n    index: gamepad.index,\n    leftStick: applyRadialDeadzone(gamepad.axes[0] ?? 0, gamepad.axes[1] ?? 0, deadzone),\n    rightStick: applyRadialDeadzone(gamepad.axes[2] ?? 0, gamepad.axes[3] ?? 0, deadzone),\n    timestamp: gamepad.timestamp,\n  }","sourceCodeStart":105,"sourceCodeEnd":141,"githubUrl":"https://github.com/moeru-ai/airi/blob/9c213115f8bd0fff9e6eabab02b077ac32da21be/packages/input-gamepad/src/standard-gamepad.ts#L105-L141","documentation":"createStandardGamepadSnapshot validates the caller-supplied `options.deadzone` before using it in applyRadialDeadzone. The value must be finite and in [0, 1). NaN/Infinity (including a non-numeric override), negative values, and values >= 1 would either poison stick math or completely swallow all stick input, so the function rejects them up front with this sentinel validation error.","triggerScenarios":"Thrown at packages/input-gamepad/src/standard-gamepad.ts:123 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass a deadzone in [0, 1), e.g. `{ deadzone: 0.12 }`, or omit the option to use the built-in default of 0.12.","Check the configured value where the options object is built (settings UI, config file) and clamp or reject it there.","Use a bounded input control (number input with min 0, max 0.99) so invalid values cannot reach this function."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"9c213115f8bd0fff9e6eabab02b077ac32da21be","analyzedAt":"2026-09-02T04:27:24.639Z","contentChangedAt":"2026-09-02T04:27:24.639Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}