summaryrefslogtreecommitdiff
path: root/Source/Core/InputCommon/ControllerInterface/Device.h
diff options
context:
space:
mode:
authorLioncash <mathew1800@gmail.com>2014-07-15 12:11:17 -0400
committerLioncash <mathew1800@gmail.com>2014-07-15 12:11:17 -0400
commitebd029973a730d6a6d6653621a2565fbdc38e49d (patch)
treed438e3232afcfb8b31f9324d87df7ebab759db29 /Source/Core/InputCommon/ControllerInterface/Device.h
parent01cd90deef0ebeb1b8960dbdb2952d143f34a60a (diff)
parentff918df88991710d58d983aa2e5dbcf03f2064ab (diff)
Merge pull request #604 from magcius/wip/emu-cleanup-2
Start cleaning up the input interface
Diffstat (limited to 'Source/Core/InputCommon/ControllerInterface/Device.h')
-rw-r--r--Source/Core/InputCommon/ControllerInterface/Device.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/Source/Core/InputCommon/ControllerInterface/Device.h b/Source/Core/InputCommon/ControllerInterface/Device.h
index a096bcb8b9..6e1868a4ba 100644
--- a/Source/Core/InputCommon/ControllerInterface/Device.h
+++ b/Source/Core/InputCommon/ControllerInterface/Device.h
@@ -42,6 +42,8 @@ public:
virtual std::string GetName() const = 0;
virtual ~Control() {}
+ bool InputGateOn();
+
virtual Input* ToInput() { return nullptr; }
virtual Output* ToOutput() { return nullptr; }
};
@@ -59,6 +61,16 @@ public:
virtual ControlState GetState() const = 0;
+ bool ShouldHaveInput();
+
+ ControlState GetGatedState()
+ {
+ if (InputGateOn())
+ return GetState();
+ else
+ return 0.0;
+ }
+
Input* ToInput() override { return this; }
};
@@ -74,6 +86,12 @@ public:
virtual void SetState(ControlState state) = 0;
+ void SetGatedState(ControlState state)
+ {
+ if (InputGateOn())
+ SetState(state);
+ }
+
Output* ToOutput() override { return this; }
};