mirror of
https://github.com/cemu-project/Cemu.git
synced 2025-07-08 16:01:19 +12:00
input: Add option to make show screen
button a toggle (#1383)
This commit is contained in:
parent
d6575455ee
commit
f9a4b2dbb1
7 changed files with 64 additions and 31 deletions
|
@ -686,3 +686,14 @@ bool VPADController::set_default_mapping(const std::shared_ptr<ControllerBase>&
|
|||
|
||||
return mapping_updated;
|
||||
}
|
||||
|
||||
void VPADController::load(const pugi::xml_node& node)
|
||||
{
|
||||
if (const auto value = node.child("toggle_display"))
|
||||
m_screen_active_toggle = ConvertString<bool>(value.child_value());
|
||||
}
|
||||
|
||||
void VPADController::save(pugi::xml_node& node)
|
||||
{
|
||||
node.append_child("toggle_display").append_child(pugi::node_pcdata).set_value(fmt::format("{}", (int)m_screen_active_toggle).c_str());
|
||||
}
|
||||
|
|
|
@ -66,6 +66,8 @@ public:
|
|||
|
||||
bool is_mic_active() { return m_mic_active; }
|
||||
bool is_screen_active() { return m_screen_active; }
|
||||
bool is_screen_active_toggle() { return m_screen_active_toggle; }
|
||||
void set_screen_toggle(bool toggle) {m_screen_active_toggle = toggle;}
|
||||
|
||||
static std::string_view get_button_name(ButtonId id);
|
||||
|
||||
|
@ -86,9 +88,13 @@ public:
|
|||
|
||||
bool set_default_mapping(const std::shared_ptr<ControllerBase>& controller) override;
|
||||
|
||||
void load(const pugi::xml_node& node) override;
|
||||
void save(pugi::xml_node& node) override;
|
||||
|
||||
private:
|
||||
bool m_mic_active = false;
|
||||
bool m_screen_active = false;
|
||||
bool m_screen_active_toggle = false;
|
||||
uint32be m_last_holdvalue = 0;
|
||||
|
||||
std::chrono::high_resolution_clock::time_point m_last_hold_change{}, m_last_pulse{};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue