1 // Copyright 2017 Dolphin Emulator Project 2 // Licensed under GPLv2+ 3 // Refer to the license.txt file included. 4 5 #pragma once 6 7 #include <string> 8 9 #include "InputCommon/ControlReference/ControlReference.h" 10 #include "InputCommon/ControllerEmu/Control/Control.h" 11 #include "InputCommon/ControllerEmu/ControlGroup/ControlGroup.h" 12 #include "InputCommon/ControllerEmu/Setting/NumericSetting.h" 13 14 namespace ControllerEmu 15 { 16 class Buttons : public ControlGroup 17 { 18 public: 19 explicit Buttons(const std::string& name_); 20 Buttons(const std::string& ini_name, const std::string& group_name); 21 22 template <typename C> GetState(C * const buttons,const C * bitmasks)23 void GetState(C* const buttons, const C* bitmasks) 24 { 25 for (auto& control : controls) 26 *buttons |= *(bitmasks++) * control->GetState<bool>(); 27 } 28 }; 29 } // namespace ControllerEmu 30