mirror of
https://github.com/RPCS3/rpcs3.git
synced 2024-11-26 04:32:35 +01:00
Qt: add boot by pressing enter or return while having an item selected
This commit is contained in:
parent
87194e5887
commit
0c4cdaa7d3
@ -1021,6 +1021,31 @@ bool game_list_frame::eventFilter(QObject *object, QEvent *event)
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (keyEvent->key() == Qt::Key_Enter || keyEvent->key() == Qt::Key_Return)
|
||||
{
|
||||
QTableWidgetItem* item;
|
||||
|
||||
if (object == m_gameList)
|
||||
item = m_gameList->item(m_gameList->currentRow(), gui::column_icon);
|
||||
else
|
||||
item = m_xgrid->currentItem();
|
||||
|
||||
if (!item || !item->isSelected())
|
||||
return false;
|
||||
|
||||
game_info gameinfo = GetGameInfoFromItem(item);
|
||||
|
||||
if (gameinfo.get() == nullptr)
|
||||
return false;
|
||||
|
||||
LOG_NOTICE(LOADER, "Booting from gamelist by pressing %s...", keyEvent->key() == Qt::Key_Enter ? "Enter" : "Return");
|
||||
Q_EMIT RequestBoot(gameinfo->info.path);
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (event->type() == QEvent::ToolTip)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user