Add mappable key to toggle networking

Fixes #17352

Requested in #17343
This commit is contained in:
Henrik Rydgård committed 2023-08-23 22:14:51 +02:00
1 parent 18b0f3be5d
commit feb0ea245e
5 files changed
+19 -6

No files matched your search

+10
View File
@@ -794,6 +794,16 @@ void EmuScreen::onVKey(int virtualKeyCode, bool down) {
if (down)
g_Config.iInternalScreenRotation = ROTATION_LOCKED_HORIZONTAL180;
break;
case VIRTKEY_TOGGLE_WLAN:
if (down) {
auto n = GetI18NCategory(I18NCat::NETWORKING);
auto di = GetI18NCategory(I18NCat::DIALOG);
g_Config.bEnableWlan = !g_Config.bEnableWlan;
// Try to avoid adding more strings so we piece together a message from existing ones.
g_OSD.Show(OSDType::MESSAGE_INFO, StringFromFormat(
"%s: %s", n->T("Enable networking"), g_Config.bEnableWlan ? di->T("Enabled") : di->T("Disabled")), 2.0, "toggle_wlan");
}
break;
}
}