five-on-it / apps/client/src/renderer/input
apps/client/src/renderer/input
Key bindings as a pure mapping from the set of pressed KeyboardEvent.codes to a VehicleInput. Positive steer is left (see packages/sim); on foot the same axes walk the character and Space jumps. The one-shot keys (V next class, E get in or out, F use, G drop on foot, X next slot, 1 and 2 in a garage) are not held keys; the game loop sets their fields from a key press, and the siren from its own switch (G at the wheel). E held is the interaction key held too (it picks a car's lock).