summaryrefslogtreecommitdiffstats
path: root/src/input_common/input_engine.h
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2022-02-24 20:42:51 +0100
committerGitHub <noreply@github.com>2022-02-24 20:42:51 +0100
commit1079215871cc15452e58aea59630871ea183feeb (patch)
treeac74f8005fc0f98ebdc3206037a83dc55db5ce1b /src/input_common/input_engine.h
parentMerge pull request #7933 from german77/am_update (diff)
parentinput_common: Remove battery duplicated struct and update every button press (diff)
downloadyuzu-1079215871cc15452e58aea59630871ea183feeb.tar
yuzu-1079215871cc15452e58aea59630871ea183feeb.tar.gz
yuzu-1079215871cc15452e58aea59630871ea183feeb.tar.bz2
yuzu-1079215871cc15452e58aea59630871ea183feeb.tar.lz
yuzu-1079215871cc15452e58aea59630871ea183feeb.tar.xz
yuzu-1079215871cc15452e58aea59630871ea183feeb.tar.zst
yuzu-1079215871cc15452e58aea59630871ea183feeb.zip
Diffstat (limited to 'src/input_common/input_engine.h')
-rw-r--r--src/input_common/input_engine.h18
1 files changed, 4 insertions, 14 deletions
diff --git a/src/input_common/input_engine.h b/src/input_common/input_engine.h
index c6c027aef..f44e0799b 100644
--- a/src/input_common/input_engine.h
+++ b/src/input_common/input_engine.h
@@ -34,16 +34,6 @@ struct BasicMotion {
u64 delta_timestamp{};
};
-// Stages of a battery charge
-enum class BatteryLevel {
- Empty,
- Critical,
- Low,
- Medium,
- Full,
- Charging,
-};
-
// Types of input that are stored in the engine
enum class EngineInputType {
None,
@@ -178,7 +168,7 @@ public:
bool GetButton(const PadIdentifier& identifier, int button) const;
bool GetHatButton(const PadIdentifier& identifier, int button, u8 direction) const;
f32 GetAxis(const PadIdentifier& identifier, int axis) const;
- BatteryLevel GetBattery(const PadIdentifier& identifier) const;
+ Common::Input::BatteryLevel GetBattery(const PadIdentifier& identifier) const;
BasicMotion GetMotion(const PadIdentifier& identifier, int motion) const;
int SetCallback(InputIdentifier input_identifier);
@@ -189,7 +179,7 @@ protected:
void SetButton(const PadIdentifier& identifier, int button, bool value);
void SetHatButton(const PadIdentifier& identifier, int button, u8 value);
void SetAxis(const PadIdentifier& identifier, int axis, f32 value);
- void SetBattery(const PadIdentifier& identifier, BatteryLevel value);
+ void SetBattery(const PadIdentifier& identifier, Common::Input::BatteryLevel value);
void SetMotion(const PadIdentifier& identifier, int motion, const BasicMotion& value);
virtual std::string GetHatButtonName([[maybe_unused]] u8 direction_value) const {
@@ -202,13 +192,13 @@ private:
std::unordered_map<int, u8> hat_buttons;
std::unordered_map<int, float> axes;
std::unordered_map<int, BasicMotion> motions;
- BatteryLevel battery{};
+ Common::Input::BatteryLevel battery{};
};
void TriggerOnButtonChange(const PadIdentifier& identifier, int button, bool value);
void TriggerOnHatButtonChange(const PadIdentifier& identifier, int button, u8 value);
void TriggerOnAxisChange(const PadIdentifier& identifier, int axis, f32 value);
- void TriggerOnBatteryChange(const PadIdentifier& identifier, BatteryLevel value);
+ void TriggerOnBatteryChange(const PadIdentifier& identifier, Common::Input::BatteryLevel value);
void TriggerOnMotionChange(const PadIdentifier& identifier, int motion,
const BasicMotion& value);