Commit Graph

42 Commits

Author SHA1 Message Date
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 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 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 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 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 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 81923034f6 ControlMapper: Keep track of when inputs were triggered 2023-12-21 12:02:15 +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 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 c037f6731d Better (but not great) workaround for key bindings that pop up dialogs. 2023-05-02 21:36:17 +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 f3012f6914 Break out the signed->unsigned axis mapping 2023-04-01 09:07:29 +02:00
Henrik Rydgård 04321284c0 Remove redundant callback 2023-04-01 08:57:42 +02:00
Henrik Rydgård 48993f4f4b Control: Add debug display, do assorted fixes. 2023-03-31 20:12:48 +02:00
Henrik Rydgård 025ec248e4 Don't need two SetCallback functions. 2023-03-31 11:11:46 +02:00
Henrik Rydgård ea60ff2235 Add missing locking to control mapper 2023-03-31 11:05:33 +02:00
Henrik Rydgård fa0fb6eee6 Rework and simplify VIRTKEY_SPEED_ANALOG 2023-03-31 11:05:33 +02:00
Henrik Rydgård ca300a4dfd More callback fixes 2023-03-31 11:05:33 +02:00
Henrik Rydgård 7dfa587fe2 Remove in/out function arguments 2023-03-31 11:05:33 +02:00
Henrik Rydgård 526b4f782d Fixes, add callback for analog virtual keys
Some fixes
2023-03-31 11:05:33 +02:00
Henrik Rydgård 8dabcaea7d Enable virtual key mappings in UpdatePSPState 2023-03-31 11:05:32 +02:00
Henrik Rydgård 38f4cc4cc9 Make reverse mapping lookup work for the simple PSP buttons. 2023-03-31 11:05:29 +02:00
Henrik Rydgård 26bf40c497 ControlMapper: Change the callbacks to be more suitable for the upcoming refactor. (#17209)
* ControlMapper: Change the callbacks to be more suitable for the upcoming refactor.

* SetAllButtons: Separate bits to set and bits to clear.

* Oops, missed committing some files somehow
2023-03-30 10:47:28 +02:00
Henrik Rydgård a4bfb83982 Some more renaming 2023-03-28 00:23:18 +02:00
Henrik Rydgård 534896d2ab ControlMapper: Allow overriding PSP button event handling through a callback. 2023-03-28 00:23:18 +02:00
Henrik Rydgård 07114c6aaf Remove return value from axis functions in API 2023-01-10 10:12:37 +01:00
Henrik Rydgård f68ba55f96 Minor initialization cleanups 2022-12-22 11:13:52 +01:00
Henrik Rydgård 5230fc7c41 Joystick input: Ignore in-deadzone events from a different device than previous events
Fixes #15465
2022-11-23 12:22:59 +01:00
Unknown W. Brackets c15c4a6967 UI: Add analog speed limit mapping.
Only shows up as a setting if mapped, to avoid cluttering settings.
2022-07-04 19:14:05 -07:00
iota97 498878267a Customizable touch control (rebased with label) 2021-07-11 09:55:25 +02:00
Henrik Rydgård ef51097f06 Move auto-rotation code to ControlMapper so it can be checked using the new screen 2021-07-09 16:14:51 +02:00
Henrik Rydgård 2303926e88 Replace the "Test Analogs" screen with a new screen that lets you directly try the settings. 2021-07-09 13:10:16 +02:00
Henrik Rydgård 42f7ab7341 Hide the calls to ConvertAnalogStick inside ControlMapper. 2021-07-09 11:01:56 +02:00
Henrik Rydgård 98372c465f Break out EmuScreen's key/axis inputs to ControlMapper.cpp/h
Additionally, break out the analog stick mapping to the same file.

This will make more sense soon when I change where the analog mapping
is called from, but want this refactor in separately for testing.
2021-07-08 22:24:00 +02:00