|
40 | 40 | #include "gui/helpers/wxHelpers.h" |
41 | 41 | #include "Cafe/HW/Latte/Renderer/Vulkan/VsyncDriver.h" |
42 | 42 | #include "gui/input/InputSettings2.h" |
| 43 | +#include "gui/input/HotkeySettings.h" |
43 | 44 | #include "input/InputManager.h" |
44 | 45 |
|
45 | 46 | #if BOOST_OS_WINDOWS |
|
91 | 92 | MAINFRAME_MENU_ID_OPTIONS_GENERAL2, |
92 | 93 | MAINFRAME_MENU_ID_OPTIONS_AUDIO, |
93 | 94 | MAINFRAME_MENU_ID_OPTIONS_INPUT, |
| 95 | + MAINFRAME_MENU_ID_OPTIONS_HOTKEY, |
94 | 96 | MAINFRAME_MENU_ID_OPTIONS_MAC_SETTINGS, |
95 | 97 | // options -> account |
96 | 98 | MAINFRAME_MENU_ID_OPTIONS_ACCOUNT_1 = 20350, |
@@ -189,6 +191,7 @@ EVT_MENU(MAINFRAME_MENU_ID_OPTIONS_GENERAL, MainWindow::OnOptionsInput) |
189 | 191 | EVT_MENU(MAINFRAME_MENU_ID_OPTIONS_GENERAL2, MainWindow::OnOptionsInput) |
190 | 192 | EVT_MENU(MAINFRAME_MENU_ID_OPTIONS_AUDIO, MainWindow::OnOptionsInput) |
191 | 193 | EVT_MENU(MAINFRAME_MENU_ID_OPTIONS_INPUT, MainWindow::OnOptionsInput) |
| 194 | +EVT_MENU(MAINFRAME_MENU_ID_OPTIONS_HOTKEY, MainWindow::OnOptionsInput) |
192 | 195 | EVT_MENU(MAINFRAME_MENU_ID_OPTIONS_MAC_SETTINGS, MainWindow::OnOptionsInput) |
193 | 196 | // tools menu |
194 | 197 | EVT_MENU(MAINFRAME_MENU_ID_TOOLS_MEMORY_SEARCHER, MainWindow::OnToolsInput) |
@@ -933,6 +936,12 @@ void MainWindow::OnOptionsInput(wxCommandEvent& event) |
933 | 936 | break; |
934 | 937 | } |
935 | 938 |
|
| 939 | + case MAINFRAME_MENU_ID_OPTIONS_HOTKEY: |
| 940 | + { |
| 941 | + auto* frame = new HotkeySettings(this); |
| 942 | + frame->Show(); |
| 943 | + break; |
| 944 | + } |
936 | 945 | } |
937 | 946 | } |
938 | 947 |
|
@@ -1446,13 +1455,7 @@ void MainWindow::OnKeyUp(wxKeyEvent& event) |
1446 | 1455 | if (swkbd_hasKeyboardInputHook()) |
1447 | 1456 | return; |
1448 | 1457 |
|
1449 | | - const auto code = event.GetKeyCode(); |
1450 | | - if (code == WXK_ESCAPE) |
1451 | | - SetFullScreen(false); |
1452 | | - else if (code == WXK_RETURN && event.AltDown() || code == WXK_F11) |
1453 | | - SetFullScreen(!IsFullScreen()); |
1454 | | - else if (code == WXK_F12) |
1455 | | - g_window_info.has_screenshot_request = true; // async screenshot request |
| 1458 | + HotkeySettings::CaptureInput(event); |
1456 | 1459 | } |
1457 | 1460 |
|
1458 | 1461 | void MainWindow::OnKeyDown(wxKeyEvent& event) |
@@ -2189,6 +2192,7 @@ void MainWindow::RecreateMenu() |
2189 | 2192 | #endif |
2190 | 2193 | optionsMenu->Append(MAINFRAME_MENU_ID_OPTIONS_GENERAL2, _("&General settings")); |
2191 | 2194 | optionsMenu->Append(MAINFRAME_MENU_ID_OPTIONS_INPUT, _("&Input settings")); |
| 2195 | + optionsMenu->Append(MAINFRAME_MENU_ID_OPTIONS_HOTKEY, _("&Hotkey settings")); |
2192 | 2196 |
|
2193 | 2197 | optionsMenu->AppendSeparator(); |
2194 | 2198 | optionsMenu->AppendSubMenu(m_optionsAccountMenu, _("&Active account")); |
|
0 commit comments