mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-04-21 03:55:32 +00:00
Allow unbinding pad buttons by right clicking (#13283)
This commit is contained in:
parent
a700e3b39e
commit
52b67b46fc
1 changed files with 17 additions and 0 deletions
|
@ -998,6 +998,23 @@ bool pad_settings_dialog::eventFilter(QObject* object, QEvent* event)
|
|||
{
|
||||
case QEvent::MouseButtonRelease:
|
||||
{
|
||||
// On right click clear binding if we are not remapping pad button
|
||||
if (m_button_id == button_ids::id_pad_begin)
|
||||
{
|
||||
QMouseEvent* mouse_event = static_cast<QMouseEvent*>(event);
|
||||
if (const auto button = qobject_cast<QPushButton*>(object); button && mouse_event->button() == Qt::RightButton)
|
||||
{
|
||||
if (const int button_id = m_pad_buttons->id(button); m_cfg_entries.contains(button_id))
|
||||
{
|
||||
m_cfg_entries[button_id].key.clear();
|
||||
m_cfg_entries[button_id].text.clear();
|
||||
UpdateLabels();
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Disabled buttons should not absorb mouseclicks
|
||||
event->ignore();
|
||||
break;
|
||||
|
|
Loading…
Add table
Reference in a new issue