summaryrefslogtreecommitdiff
path: root/Source/Core/InputCommon/ControllerInterface/CoreDevice.h
diff options
context:
space:
mode:
authorAdmiral H. Curtiss <pikachu025@gmail.com>2024-11-04 11:04:50 +0100
committerGitHub <noreply@github.com>2024-11-04 11:04:50 +0100
commitb8823457c14248b61ffb400c6af080db2aa799b0 (patch)
tree444be031ade83f8ef00c719f3dc1b813d780bafb /Source/Core/InputCommon/ControllerInterface/CoreDevice.h
parent6a59e83bbba2a1495a89a844e636f67aa87a32a8 (diff)
parent346a9e0f97d4e17abb237a638896ef43db30488f (diff)
Merge pull request #13165 from jordan-woyak/FullAnalogSurface-rename
InputCommon: Rename AddAnalogInputs to AddFullAnalogSurfaceInputs.
Diffstat (limited to 'Source/Core/InputCommon/ControllerInterface/CoreDevice.h')
-rw-r--r--Source/Core/InputCommon/ControllerInterface/CoreDevice.h30
1 files changed, 8 insertions, 22 deletions
diff --git a/Source/Core/InputCommon/ControllerInterface/CoreDevice.h b/Source/Core/InputCommon/ControllerInterface/CoreDevice.h
index 33a322861b..cd8256396e 100644
--- a/Source/Core/InputCommon/ControllerInterface/CoreDevice.h
+++ b/Source/Core/InputCommon/ControllerInterface/CoreDevice.h
@@ -163,28 +163,14 @@ protected:
void AddInput(Input* const i);
void AddOutput(Output* const o);
- class FullAnalogSurface final : public Input
- {
- public:
- FullAnalogSurface(Input* low, Input* high) : m_low(*low), m_high(*high) {}
- ControlState GetState() const override;
- std::string GetName() const override;
- bool IsDetectable() const override;
- bool IsHidden() const override;
- bool IsMatchingName(std::string_view name) const override;
-
- private:
- Input& m_low;
- Input& m_high;
- };
-
- void AddAnalogInputs(Input* low, Input* high)
- {
- AddInput(low);
- AddInput(high);
- AddInput(new FullAnalogSurface(low, high));
- AddInput(new FullAnalogSurface(high, low));
- }
+ // Pass Inputs for center-neutral (- and +) directions of some axis.
+ // This function adds those Inputs and also a FullAnalogSurface Input for each direction.
+ // This is only needed when it's not known if the particular axis is neutral in the center
+ // or neutral on one of the extremes.
+ // Some e.g. DInput devices expose a trigger across the full analog surface
+ // but we have no way of knowing this until the user actually maps the Input,
+ // so both center-neutral and full-surface Inputs need to be created in that case.
+ void AddFullAnalogSurfaceInputs(Input* low, Input* high);
void AddCombinedInput(std::string name, const std::pair<std::string, std::string>& inputs);