Skip to content

Commit

Permalink
Qt: add boot by pressing enter or return while having an item selected
Browse files Browse the repository at this point in the history
  • Loading branch information
Megamouse authored and kd-11 committed Jun 19, 2018
1 parent 87194e5 commit 0c4cdaa
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions rpcs3/rpcs3qt/game_list_frame.cpp
Expand Up @@ -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)
{
Expand Down

0 comments on commit 0c4cdaa

Please sign in to comment.