Add input_map.{c,h} (target xbox_input_map): named bindings and their
text format, key resolution, pad remapping, radial stick deadzones,
trigger thresholds and pad merging.
Built on #191's key table rather than beside it. A binding holds a
Windows VK code from keyboard.h, the held-key array is that table, and
the names are only the persistence format; keyboard.h gains the XBOX_VK_*
codes the names need. Outputs are XBOX_GAMEPAD with the XBOX_GAMEPAD_*
bits and XBOX_BUTTON_* slots from xinput_xbox.h, so the module has no pad
type of its own.
Stick keys keep keyboard.c's full deflection on a diagonal by default;
INPUT_DIAGONAL_ROUND opts into a unit circle. The mouse wheel has no VK
code, so wheel names are rejected and counted like any unknown name.
tests/input_map is the first version's suite ported to these types, plus
the name <-> VK table written out independently and binding strings saved
by the first version (d9a0a38).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
861 B
Input mapping fixture
See the mapping section of src/input/README.md. Build this directory directly with CMake and run CTest; no root runtime/SDL configuration is required. Explicit C checks execute in Release even under NDEBUG; a C++ consumer verifies extern-C linkage and the actual mapping target.
Coverage: key names/aliases and their virtual-key codes (written out independently of the module), binding strings saved by the first version of this module, binding parse/format/clear/duplicates/limits, keyboard resolution and both diagonal rules, whole-vector merging, mapping/disabled or swapped sticks, deadzones, triggers, immutable names, long binding text, malformed counts/codes and range/roundtrip properties. Fixtures have no device, game data, save files or guest code dependencies.