Commit Graph

78 Commits

Author SHA1 Message Date
Henrik Rydgård f703bc69c4 Analog stick autorotation now uses game timing.
Should fix frameskipping problem, where this didn't work in God of War
if frameskipping was on.
2026-03-31 11:14:48 -06:00
Henrik Rydgård 232ea1a8a1 Add a "hold" version of the axis swap toggle. Often more convenient.
This is useful for working around some annoying control schemes.

Fixes #21354
2026-03-05 23:05:35 +01:00
Henrik Rydgård 3352ba44bb Remove misguided hack to signal that we handled key repeats.
Fixes #21336
2026-03-05 01:55:41 +01:00
Henrik Rydgård 892ef99daa Misc cleanups and fixes 2026-03-04 14:41:59 +01:00
Henrik Rydgård e780e32f98 Controls: Add a setting for the threshold used to map analog stick inputs to digital buttons 2026-03-02 22:50:15 +01:00
Henrik Rydgård 5a5c7028b9 Assorted warning fixes and data initialization to please valgrind 2026-02-19 11:24:46 +01:00
Henrik Rydgård 734b2a55de Move to a global controlmapper 2026-02-12 23:06:26 +01:00
Henrik Rydgård c5e257635f ControlMapper: Support multiple listeners 2026-02-12 23:01:46 +01:00
Henrik Rydgård a6ac956884 Input system refactor: Replace 5 callbacks with an interface 2026-02-12 22:52:16 +01:00
Henrik Rydgård c232867fba Correct functionality of the display rotation control rotation.
Fixes #19775

A future step might be to also rotate the touch screen inputs..
2026-01-23 01:18:58 +01:00
Henrik Rydgård 18a67b82d2 Do the same with KeyInputFlags. Fix minor UI misalignments 2025-12-19 13:41:58 +01:00
Henrik Rydgård 67010ff2af Split the display layout config between landscape and portrait orientations 2025-11-05 12:49:51 +01:00
Henrik Rydgård 70f1edb28f Misc sanity checks 2025-06-14 08:45:02 +02:00
Henrik Rydgård 4b77cfd53b Add confirmation popup support on Exit App key
This adds a new mechanism so we can delay "vkey" events until the next
frame, making for safer code. Will move a bunch of the virtkeys to this
later.

Fixes #20020
2025-02-24 10:23:11 -06:00
Henrik Rydgård e51c58716b Fix minor code issues flagged by PVS-Studio and reported by alphrixus. 2024-10-10 14:10:30 +02:00
Henrik Rydgård e01ca5b057 Logging API change (refactor) (#19324)
* Rename LogType to Log

* Explicitly use the Log:: enum when logging. Allows for autocomplete when editing.

* Mac/ARM64 buildfix

* Do the same with the hle result log macros

* Rename the log names to mixed case while at it.

* iOS buildfix

* Qt buildfix attempt, ARM32 buildfix
2024-07-14 14:42:59 +02:00
Henrik Rydgård c7c7e0a36d Fix the AxisSwap feature - had a double mutex lock, oops. 2024-04-14 13:43:20 +02:00
Henrik Rydgård cf1fd714fd Merge pull request #18786 from hrydgard/release-inputs-on-pause
Release all keys on pause.
2024-01-29 19:21:22 +01:00
Henrik Rydgård 1faef374a9 Strengthen the axis-threshold reduction for related axes a bit. See #17792 2024-01-29 18:50:08 +01:00
Henrik Rydgård 7920d3a44b Release all keys on pause.
Fixes #18767

Not sure about merging for the 1.17 series though, maybe someone really
likes to bring up the pause menu briefly while holding a direction.. we
could actually handle that with some extra logic.
2024-01-29 18:41:43 +01:00
Henrik Rydgård 04ea4987b0 Bring back the old combo behavior, make the new behavior a checkbox (strict combo order). 2024-01-29 18:06:31 +01:00
Henrik Rydgård 3e53d1e895 Joystick input: Fix low-end radius (inverse deadzone) 2023-12-31 16:47:26 +01:00
Henrik Rydgård 706b98a0b9 Joystick: Bias down the axis-to-button threshold if the "co-axis" is active.
This makes it much easier to hit the diagonals in the case where you map
the right stick on your 360 controller to say the DPAD for camera
control in some game.

No setting, let's see if that's required.

Fixes #17792, it should now "just work".
2023-12-31 13:55:04 +01:00
Henrik Rydgård 3895cfff74 Add "Analog trigger threshold" setting, for conversion of analog trigger inputs to digital button inputs. 2023-12-28 13:36:03 +01:00
Henrik Rydgård 33c0052c70 Merge pull request #18597 from hrydgard/combo-key-behavior
Combo key: Only trigger when keys are pressed in the mapped order
2023-12-22 22:52:23 +01:00
Henrik Rydgård d21b185b5c Combo keys: Only trigger if keys are pressed in the same order 2023-12-21 12:07:14 +01:00
Henrik Rydgård 81923034f6 ControlMapper: Keep track of when inputs were triggered 2023-12-21 12:02:15 +01:00
Henrik Rydgård 16a31c2554 Avoid spamming the keymap lock during input processing 2023-12-21 11:54:30 +01:00
Henrik Rydgård 144ed7a3ab Reduce memory allocations during controller processing 2023-12-21 11:15:40 +01:00
Henrik Rydgård ee93e4a2ca Batch axis events all the way into ControlMapper 2023-09-29 11:14:19 +02:00
Henrik Rydgård 65a787026d Fix a range check and array size. In reality, probably not a danger. 2023-09-27 17:36:51 +02:00
Henrik Rydgård 72be2f5459 Restore the D-Pad behavior (see #18028) 2023-09-11 11:41:29 +02:00
Henrik Rydgård be2f81c3eb Controls: Make the analog/digital mapping clash resolution more gentle.
Now takes the time into account, so clashing digital input will only shrink
analog inputs once it's a few seconds old.

Also fixes a bug where if there are both inputs, it was hard to reach
the limits because the digital input itself ended up getting shrunk.

This might help #17860
2023-08-23 18:51:27 +02:00
Henrik Rydgård a07079bdf9 Timestamp control inputs 2023-08-23 17:52:30 +02:00
Henrik Rydgård 9623f515e7 Add back support for custom buttons to control analog inputs 2023-05-08 10:46:28 +02:00
Henrik Rydgård b0d05a5a7c Remove some logic that did not do the right thing 2023-05-02 23:51:40 +02:00
Henrik Rydgård c037f6731d Better (but not great) workaround for key bindings that pop up dialogs. 2023-05-02 21:36:17 +02:00
Henrik Rydgård 4bb7c05132 Remove some unnecessary state clearing 2023-04-20 11:00:19 +02:00
Henrik Rydgård 7594ae8785 Resurrect and refactor the AxisSwap feature. Fixes #17292 2023-04-20 10:53:11 +02:00
Henrik Rydgård 9612bff2ac Properly fix the analog limiter feature ("lightly"). 2023-04-15 19:56:27 +02:00
Henrik Rydgård 23c940370e abs->fabsf. Might fix #17284 2023-04-15 10:13:57 +02:00
Henrik Rydgård d1e21ab896 Fix return value from control mapper Key. Fixes volume key issue on Android. 2023-04-02 10:41:26 +02:00
Henrik Rydgård c1b5aed9b7 Cleanup, confine g_controllerMap access to KeyMap.cpp 2023-04-01 20:28:42 +02:00
Henrik Rydgård d523005c2b Cleanup 2023-04-01 19:02:20 +02:00
Henrik Rydgård 0e1c42ce70 Plumb multimappings all the way through. 2023-04-01 13:50:57 +02:00
Henrik Rydgård f3012f6914 Break out the signed->unsigned axis mapping 2023-04-01 09:07:29 +02:00
Henrik Rydgård 0b574613b9 Address assorted feedback 2023-04-01 09:01:27 +02:00
Henrik Rydgård 04321284c0 Remove redundant callback 2023-04-01 08:57:42 +02:00
Henrik Rydgård 9804a905c8 More tweaks (work around the old problem where lingering analog values biased the digital input) 2023-03-31 20:27:30 +02:00
Henrik Rydgård 48993f4f4b Control: Add debug display, do assorted fixes. 2023-03-31 20:12:48 +02:00