Commit Graph

8 Commits

Author SHA1 Message Date
dantdmdarealguy 3c581619d3 feat(input): configure stick deadzones and mouse sensitivity
anyps5-input.ini accepts LeftStickDeadzone and RightStickDeadzone (whole
percent, 0 to 90), a radial deadzone on the controller sticks whose
remaining travel is rescaled to the full range, and MouseSensitivity
(above 0, at most 10), which replaces the fixed factor of 1 for mouse
look. The defaults keep the current mapping exactly.
2026-10-11 15:57:12 -05:00
OverkillLabs e532b19cee refactor(pad): trim comments and apply naming conventions
Bring the pad-gamepad-haptics diff in line with docs/dev/CONVENTIONS.md:
strip explanatory/rationale comments (struct layouts, algorithm notes,
rewired-NID rationale) down to code only, and rename the anonymous-
namespace helpers in PadState.cpp (Normalize/Fuse/EncodeZones/MaxOf/
ScaleStrength) to camelCase to match upstream's free-function style.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-29 04:24:39 +03:00
OverkillLabs 1d245cbeb2 videoout: bridge SDL sensor/haptics to pad output alongside existing input-mapping flow
Reconcile our SDL gamepad motion/haptics work with upstream's
configurable keyboard/mouse binding feature (PadInput now built around
Pad::LoadInputMapping() and a std::vector<Pad::InputBinding>). Upstream's
openFirstAvailableController()/openController(deviceIndex) flow and
HandleEvent/Update/publish logic for keyboard, mouse, and wheel
bindings are kept as-is (including APS5_NO_PAD_INPUT handling); the
sensor-enabling and host-haptics steps are grafted on as additional
work done once a controller is open:

- openController(deviceIndex) now also calls enableSensors() and
  marks a re-apply of the current guest output request pending.
- New sampleController()/applyOutput()/enableSensors() bring in real
  gamepad sampling, motion sensor reads, DualSense touchpad finger
  tracking, and pushing rumble/light bar/adaptive trigger state out via
  SDL_GameControllerRumble/SetLED/SendEffect. sampleController()'s
  button list and trigger/stick scaling are an exact copy of the
  button/trigger/stick reading that used to be inlined in publish()
  under the SDL_GameControllerGetAttached check (no deadzone added,
  no extra button remapped) -- only the motion, touchpad, and
  device-kind sampling on top of it are new.
- Update() now also samples the controller and applies pending output
  every tick, in addition to upstream's SDL_GameControllerUpdate() call
  and its keyboard/mouse/wheel timing logic.
- publish() seeds PadInputState from the sampled gamepad state first
  (buttons/sticks/analog triggers/motion/touch/device kind), then
  layers upstream's keyboard/mouse binding loop on top exactly as
  upstream had it, so a bound key still overrides the gamepad the same
  way it did before this merge. Upstream's L2/R2 button-flag derivation
  is preserved, just computed once at the end from whichever value
  (gamepad or a keyboard/mouse override) ends up in analogButtonsL2/R2.
- The background-events SDL hint is now set unconditionally (previously
  only inside the "not yet initialized" branch), since upstream's own
  VideoOutDriver already brings up SDL_INIT_GAMECONTROLLER before
  PadInput is constructed, which meant the hint would never run.

No changes were needed in VideoOutDriver.cpp: PadInput lazily
initializes SDL_INIT_GAMECONTROLLER itself in
openFirstAvailableController() (already a no-op if the subsystem is up),
and the class's public interface (default-constructible, HandleEvent/
Update) is unchanged, so upstream's existing `PadInput padInput;` /
HandleEvent / Update call sites keep working without modification.
VideoOutDriver.cpp's own independent flip-queue/vblank-telemetry rework
was left untouched as out of scope.

Confidence: high for the keyboard/mouse binding path (untouched) and
for the gamepad button/stick/trigger path (byte-for-byte copy of the
pre-existing mapping); the new motion/haptics/touchpad code is novel
and builds/links cleanly but has not been run against real hardware.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-28 13:43:27 +03:00
MartinCajiao 0644a8c38f feat(input): support SDL game controllers 2026-09-27 20:27:22 -05:00
MartinCajiao c13f0eee67 feat(input): allow configurable keyboard and mouse bindings 2026-09-27 19:54:19 -05:00
boykopovar 6b8e16b73e feat(video): fullsceen mode by f11 2026-09-25 11:18:58 +03:00
boykopovar 05c8146744 refactor(pad): libScePad files structure refactor 2026-09-25 00:04:19 +03:00
boykopovar ce287648bf feat(pad): add read input state logic to libScePad 2026-09-24 23:59:12 +03:00