Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Qt: add boot by pressing enter or return while having an item selected #4777

Merged
merged 1 commit into from
Jun 19, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
25 changes: 25 additions & 0 deletions rpcs3/rpcs3qt/game_list_frame.cpp
Original file line number Diff line number Diff line change
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