mirror of
https://github.com/yuzu-emu/yuzu.git
synced 2024-11-14 17:20:06 +00:00
Draft: trying to tweak ZL/ZR triggering
This is related to Issue 9096
This commit is contained in:
parent
c75a4bdeaa
commit
de406d2728
@ -579,6 +579,9 @@ Common::ParamPackage SDLDriver::BuildAnalogParamPackageForButton(int port, const
|
|||||||
params.Set("guid", guid.RawString());
|
params.Set("guid", guid.RawString());
|
||||||
params.Set("axis", axis);
|
params.Set("axis", axis);
|
||||||
params.Set("threshold", "0.5");
|
params.Set("threshold", "0.5");
|
||||||
|
LOG_INFO(Frontend, "This didn't work");
|
||||||
|
params.Set("range", "2");
|
||||||
|
params.Set("offset", "-1.000000");
|
||||||
params.Set("invert", value < 0 ? "-" : "+");
|
params.Set("invert", value < 0 ? "-" : "+");
|
||||||
return params;
|
return params;
|
||||||
}
|
}
|
||||||
@ -615,6 +618,7 @@ Common::ParamPackage SDLDriver::BuildMotionParam(int port, const Common::UUID& g
|
|||||||
|
|
||||||
Common::ParamPackage SDLDriver::BuildParamPackageForBinding(
|
Common::ParamPackage SDLDriver::BuildParamPackageForBinding(
|
||||||
int port, const Common::UUID& guid, const SDL_GameControllerButtonBind& binding) const {
|
int port, const Common::UUID& guid, const SDL_GameControllerButtonBind& binding) const {
|
||||||
|
LOG_INFO(Frontend, "I thought this would get called when I bind the axis");
|
||||||
switch (binding.bindType) {
|
switch (binding.bindType) {
|
||||||
case SDL_CONTROLLER_BINDTYPE_NONE:
|
case SDL_CONTROLLER_BINDTYPE_NONE:
|
||||||
break;
|
break;
|
||||||
|
@ -345,6 +345,7 @@ ConfigureInputPlayer::ConfigureInputPlayer(QWidget* parent, std::size_t player_i
|
|||||||
}
|
}
|
||||||
|
|
||||||
connect(button, &QPushButton::clicked, [=, this] {
|
connect(button, &QPushButton::clicked, [=, this] {
|
||||||
|
LOG_INFO(Frontend, "Wheee");
|
||||||
HandleClick(
|
HandleClick(
|
||||||
button, button_id,
|
button, button_id,
|
||||||
[=, this](const Common::ParamPackage& params) {
|
[=, this](const Common::ParamPackage& params) {
|
||||||
@ -405,6 +406,20 @@ ConfigureInputPlayer::ConfigureInputPlayer(QWidget* parent, std::size_t player_i
|
|||||||
button_map[button_id]->setText(ButtonToText(param));
|
button_map[button_id]->setText(ButtonToText(param));
|
||||||
emulated_controller->SetButtonParam(button_id, param);
|
emulated_controller->SetButtonParam(button_id, param);
|
||||||
});
|
});
|
||||||
|
context_menu.addAction(tr("Toggle Offset"), [&] {
|
||||||
|
int offset = param.Get("offset", 0);
|
||||||
|
if (offset == 0) {
|
||||||
|
LOG_INFO(Frontend, "Boosting offset/range");
|
||||||
|
param.Set("offset", -1.0f);
|
||||||
|
param.Set("range", 2);
|
||||||
|
} else {
|
||||||
|
LOG_INFO(Frontend, "Unboosting offset/range");
|
||||||
|
param.Set("offset", 0);
|
||||||
|
param.Set("range", 1);
|
||||||
|
}
|
||||||
|
button_map[button_id]->setText(ButtonToText(param));
|
||||||
|
emulated_controller->SetButtonParam(button_id, param);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
context_menu.exec(button_map[button_id]->mapToGlobal(menu_location));
|
context_menu.exec(button_map[button_id]->mapToGlobal(menu_location));
|
||||||
});
|
});
|
||||||
@ -455,6 +470,7 @@ ConfigureInputPlayer::ConfigureInputPlayer(QWidget* parent, std::size_t player_i
|
|||||||
emulated_controller->GetButtonParam(Settings::NativeButton::ZL);
|
emulated_controller->GetButtonParam(Settings::NativeButton::ZL);
|
||||||
if (param.Has("threshold")) {
|
if (param.Has("threshold")) {
|
||||||
const auto slider_value = ui->sliderZLThreshold->value();
|
const auto slider_value = ui->sliderZLThreshold->value();
|
||||||
|
ui->sliderZLThreshold->setToolTip(QString::number(ui->sliderZLThreshold->value()));
|
||||||
param.Set("threshold", slider_value / 100.0f);
|
param.Set("threshold", slider_value / 100.0f);
|
||||||
emulated_controller->SetButtonParam(Settings::NativeButton::ZL, param);
|
emulated_controller->SetButtonParam(Settings::NativeButton::ZL, param);
|
||||||
}
|
}
|
||||||
@ -1412,6 +1428,7 @@ void ConfigureInputPlayer::HandleClick(
|
|||||||
QWidget::grabKeyboard();
|
QWidget::grabKeyboard();
|
||||||
|
|
||||||
if (type == InputCommon::Polling::InputType::Button) {
|
if (type == InputCommon::Polling::InputType::Button) {
|
||||||
|
LOG_INFO(Frontend, "Wheee");
|
||||||
ui->controllerFrame->BeginMappingButton(button_id);
|
ui->controllerFrame->BeginMappingButton(button_id);
|
||||||
} else if (type == InputCommon::Polling::InputType::Stick) {
|
} else if (type == InputCommon::Polling::InputType::Stick) {
|
||||||
ui->controllerFrame->BeginMappingAnalog(button_id);
|
ui->controllerFrame->BeginMappingAnalog(button_id);
|
||||||
|
Loading…
Reference in New Issue
Block a user