1
0
Fork 0
forked from suyu/suyu

web_browser: Add shortcut to Enter key to exit applet

Addresses issues where a user in fullscreen could not exit some web applets without leaving fullscreen.
This commit is contained in:
Zach Hilman 2019-03-04 18:24:16 -05:00
parent 07e13d6728
commit 4130b07f88
2 changed files with 7 additions and 0 deletions

View file

@ -56,6 +56,8 @@ constexpr char NX_SHIM_INJECT_SCRIPT[] = R"(
window.nx.endApplet = function() { window.nx.endApplet = function() {
applet_done = true; applet_done = true;
}; };
window.onkeypress = function(e) { if (e.keyCode === 13) { applet_done = true; } };
)"; )";
QString GetNXShimInjectionScript() { QString GetNXShimInjectionScript() {

View file

@ -339,6 +339,11 @@ void GMainWindow::WebBrowserOpenPage(std::string_view filename, std::string_view
.arg(QString::fromStdString(std::to_string(key_code)))); .arg(QString::fromStdString(std::to_string(key_code))));
}; };
QMessageBox::information(
this, tr("Exit"),
tr("To exit the web application, use the game provided controls to select exit, select the "
"'Exit Web Applet' option in the menu bar, or press the 'Enter' key."));
bool running_exit_check = false; bool running_exit_check = false;
while (!finished) { while (!finished) {
QApplication::processEvents(); QApplication::processEvents();