stateful night vision rework

This commit is contained in:
legop3
2026-01-28 13:45:01 -05:00
parent f3cc73f178
commit 7e850dab22
20 changed files with 384 additions and 176 deletions
@@ -8,6 +8,7 @@ import {
getPadSignature,
} from './gamepadBindings.js';
import { subscribeGamepadHub } from './gamepadHub.js';
import { isTextEntryActive } from './inputFocusUtils.js';
const SOURCE = 'gamepad';
const ZERO_VECTOR = { x: 0, y: 0, boost: false };
@@ -154,6 +155,21 @@ export default function GamepadInputManager() {
return;
}
if (isTextEntryActive()) {
if (!areVectorsEqual(lastVectorRef.current, ZERO_VECTOR)) {
lastVectorRef.current = ZERO_VECTOR;
setDriveVector(ZERO_VECTOR, { source: SOURCE });
}
if (!areAuxEqual(lastAuxRef.current, ZERO_AUX)) {
lastAuxRef.current = ZERO_AUX;
setAuxMotors(ZERO_AUX);
}
buttonStateRef.current = new Map();
reverseStateRef.current = { main: false, side: false };
registerInputState(SOURCE, { connected: true, blocked: true });
return;
}
ensureProfile(activePad);
const signature = activePad.signature;
const profile =