mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-04-20 19:45:20 +00:00
input/qt: fix out of bounds exception when using button ids in raw mouse config dialog
This commit is contained in:
parent
2978a9aa40
commit
13673d2c79
1 changed files with 2 additions and 2 deletions
|
@ -83,7 +83,7 @@ raw_mouse_settings_dialog::raw_mouse_settings_dialog(QWidget* parent)
|
|||
if (const int button_id = m_buttons->id(button); button_id >= 0)
|
||||
{
|
||||
auto& config = ::at32(g_cfg_raw_mouse.players, m_tab_widget->currentIndex());
|
||||
const std::string name = config->get_button_by_index(button_id).to_string();
|
||||
const std::string name = config->get_button_by_index(button_id % button_count).to_string();
|
||||
button->setText(name.empty() ? QStringLiteral("-") : QString::fromStdString(name));
|
||||
}
|
||||
}
|
||||
|
@ -349,7 +349,7 @@ bool raw_mouse_settings_dialog::eventFilter(QObject* object, QEvent* event)
|
|||
{
|
||||
button->setText(QStringLiteral("-"));
|
||||
auto& config = ::at32(g_cfg_raw_mouse.players, m_tab_widget->currentIndex());
|
||||
config->get_button_by_index(button_id).from_string("");
|
||||
config->get_button_by_index(button_id % button_count).from_string("");
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue