Building games for both desktop browsers and mobile devices requires a unified input abstraction layer that maps disparate hardware events—keyboard key codes, HTML5 Gamepad analog sticks, and touch screen coordinates—into semantic gameplay actions (e.g. `Action.JUMP`, `Action.MOVE_VECTOR`).
1. Multi-Input Event Normalization Layer
| Physical Input | Browser Event / API | Normalized Output Vector |
|---|---|---|
| Keyboard | keydown / keyup (WASD / Arrows) | 2D Vector { x: -1 to 1, y: -1 to 1 } |
| Gamepad Controller | navigator.getGamepads()[0].axes | Analog Vector with dynamic radial deadzone. |
| Mobile Touch Screen | touchstart / touchmove on Canvas | Virtual Joystick delta normalized to $[0, 1]$ radius. |
