Merge pull request #7633 from german77/hotkeys

yuzu: Add controller hotkeys
This commit is contained in:
bunnei 2022-01-11 10:49:23 -08:00 committed by GitHub
commit c65c651b6f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 626 additions and 80 deletions

View file

@ -351,6 +351,19 @@ void EmulatedController::DisableConfiguration() {
}
}
void EmulatedController::EnableSystemButtons() {
system_buttons_enabled = true;
}
void EmulatedController::DisableSystemButtons() {
system_buttons_enabled = false;
}
void EmulatedController::ResetSystemButtons() {
controller.home_button_state.home.Assign(false);
controller.capture_button_state.capture.Assign(false);
}
bool EmulatedController::IsConfiguring() const {
return is_configuring;
}
@ -600,7 +613,16 @@ void EmulatedController::SetButton(const Common::Input::CallbackStatus& callback
controller.npad_button_state.right_sr.Assign(current_status.value);
break;
case Settings::NativeButton::Home:
if (!system_buttons_enabled) {
break;
}
controller.home_button_state.home.Assign(current_status.value);
break;
case Settings::NativeButton::Screenshot:
if (!system_buttons_enabled) {
break;
}
controller.capture_button_state.capture.Assign(current_status.value);
break;
}
}
@ -1081,6 +1103,20 @@ BatteryValues EmulatedController::GetBatteryValues() const {
return controller.battery_values;
}
HomeButtonState EmulatedController::GetHomeButtons() const {
if (is_configuring) {
return {};
}
return controller.home_button_state;
}
CaptureButtonState EmulatedController::GetCaptureButtons() const {
if (is_configuring) {
return {};
}
return controller.capture_button_state;
}
NpadButtonState EmulatedController::GetNpadButtons() const {
if (is_configuring) {
return {};