From ed7318c27098f6bfde6f72432d3e531f763251bf Mon Sep 17 00:00:00 2001 From: bicarus <202771338+bicarus-dev@users.noreply.github.com> Date: Tue, 21 Jul 2026 00:26:36 -0700 Subject: [PATCH] rawinput: modifiers (key combinations) (#813) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Link to GitHub Issue or related Pull Request, if one exists Fixes #635 ## Description of change Adds optional **button modifiers**, allowing a binding to require one or more "modifier" buttons to be held before it activates. - New "Modifiers" controller page in the overlay config to bind the Modifier 1–4 source buttons. - Each binding gains a 4-bit modifier_mask (Modifier 1-4). It is persisted as an optional modifiers XML attribute on button nodes and controller-preset entries. The attribute is optional and defaults to 0, so existing config files and presets load unchanged and the feature is off unless the user opts in. - The button Edit properties popup gains a "Modifiers" dropdown to pick which modifiers a binding requires. Doesn't apply to MIDI though. - Input evaluation skips a binding whose required modifiers are not held, falling through to its alternatives; velocity reporting uses the same gated path. - Controller-preset templates gain a "Modifiers" group for importing and exporting. ## Testing --- src/spice2x/cfg/api.cpp | 77 ++++++- src/spice2x/cfg/button.cpp | 22 +- src/spice2x/cfg/button.h | 11 + src/spice2x/cfg/config.cpp | 12 ++ src/spice2x/cfg/controller_presets.cpp | 46 ++++ src/spice2x/games/io.cpp | 32 +++ src/spice2x/games/io.h | 11 + src/spice2x/overlay/windows/config.cpp | 202 +++++++++++++++--- src/spice2x/overlay/windows/config.h | 7 +- .../overlay/windows/controller_presets.cpp | 17 +- .../overlay/windows/controller_presets.h | 4 + 11 files changed, 393 insertions(+), 48 deletions(-) diff --git a/src/spice2x/cfg/api.cpp b/src/spice2x/cfg/api.cpp index e8b42e9..c2b7adf 100644 --- a/src/spice2x/cfg/api.cpp +++ b/src/spice2x/cfg/api.cpp @@ -3,7 +3,9 @@ #include #include +#include "games/io.h" #include "launcher/superexit.h" +#include "misc/eamuse.h" #include "rawinput/rawinput.h" #include "rawinput/piuio.h" #include "util/time.h" @@ -62,7 +64,43 @@ std::vector