summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
Diffstat (limited to 'src/core')
-rw-r--r--src/core/hid/emulated_controller.cpp19
-rw-r--r--src/core/hid/emulated_controller.h10
2 files changed, 29 insertions, 0 deletions
diff --git a/src/core/hid/emulated_controller.cpp b/src/core/hid/emulated_controller.cpp
index 9f68a41cc..6209c707e 100644
--- a/src/core/hid/emulated_controller.cpp
+++ b/src/core/hid/emulated_controller.cpp
@@ -351,6 +351,19 @@ void EmulatedController::DisableConfiguration() {
351 } 351 }
352} 352}
353 353
354void EmulatedController::EnableSystemButtons() {
355 system_buttons_enabled = true;
356}
357
358void EmulatedController::DisableSystemButtons() {
359 system_buttons_enabled = false;
360}
361
362void EmulatedController::ResetSystemButtons() {
363 controller.home_button_state.home.Assign(false);
364 controller.capture_button_state.capture.Assign(false);
365}
366
354bool EmulatedController::IsConfiguring() const { 367bool EmulatedController::IsConfiguring() const {
355 return is_configuring; 368 return is_configuring;
356} 369}
@@ -596,9 +609,15 @@ void EmulatedController::SetButton(const Common::Input::CallbackStatus& callback
596 controller.npad_button_state.right_sr.Assign(current_status.value); 609 controller.npad_button_state.right_sr.Assign(current_status.value);
597 break; 610 break;
598 case Settings::NativeButton::Home: 611 case Settings::NativeButton::Home:
612 if (!system_buttons_enabled) {
613 break;
614 }
599 controller.home_button_state.home.Assign(current_status.value); 615 controller.home_button_state.home.Assign(current_status.value);
600 break; 616 break;
601 case Settings::NativeButton::Screenshot: 617 case Settings::NativeButton::Screenshot:
618 if (!system_buttons_enabled) {
619 break;
620 }
602 controller.capture_button_state.capture.Assign(current_status.value); 621 controller.capture_button_state.capture.Assign(current_status.value);
603 break; 622 break;
604 } 623 }
diff --git a/src/core/hid/emulated_controller.h b/src/core/hid/emulated_controller.h
index bee16a8ed..a63a83cce 100644
--- a/src/core/hid/emulated_controller.h
+++ b/src/core/hid/emulated_controller.h
@@ -200,6 +200,15 @@ public:
200 /// Returns the emulated controller into normal mode, allowing the modification of the HID state 200 /// Returns the emulated controller into normal mode, allowing the modification of the HID state
201 void DisableConfiguration(); 201 void DisableConfiguration();
202 202
203 /// Enables Home and Screenshot buttons
204 void EnableSystemButtons();
205
206 /// Disables Home and Screenshot buttons
207 void DisableSystemButtons();
208
209 /// Sets Home and Screenshot buttons to false
210 void ResetSystemButtons();
211
203 /// Returns true if the emulated controller is in configuring mode 212 /// Returns true if the emulated controller is in configuring mode
204 bool IsConfiguring() const; 213 bool IsConfiguring() const;
205 214
@@ -391,6 +400,7 @@ private:
391 NpadStyleTag supported_style_tag{NpadStyleSet::All}; 400 NpadStyleTag supported_style_tag{NpadStyleSet::All};
392 bool is_connected{false}; 401 bool is_connected{false};
393 bool is_configuring{false}; 402 bool is_configuring{false};
403 bool system_buttons_enabled{true};
394 f32 motion_sensitivity{0.01f}; 404 f32 motion_sensitivity{0.01f};
395 bool force_update_motion{false}; 405 bool force_update_motion{false};
396 406