Browse Source
Merge pull request #2196 from DarkLordZach/web-applet-esc
web_browser: Add shortcut to Enter key to exit applet
pull/15/merge
bunnei
7 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
7 additions and
0 deletions
-
src/yuzu/applets/web_browser.cpp
-
src/yuzu/main.cpp
|
|
|
@ -56,6 +56,8 @@ constexpr char NX_SHIM_INJECT_SCRIPT[] = R"( |
|
|
|
window.nx.endApplet = function() { |
|
|
|
applet_done = true; |
|
|
|
}; |
|
|
|
|
|
|
|
window.onkeypress = function(e) { if (e.keyCode === 13) { applet_done = true; } }; |
|
|
|
)"; |
|
|
|
|
|
|
|
QString GetNXShimInjectionScript() { |
|
|
|
|
|
|
|
@ -340,6 +340,11 @@ void GMainWindow::WebBrowserOpenPage(std::string_view filename, std::string_view |
|
|
|
.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; |
|
|
|
while (!finished) { |
|
|
|
QApplication::processEvents(); |
|
|
|
|