From a69288848782a21dff410b038cd78acb1ac22dbd Mon Sep 17 00:00:00 2001 From: Natalie Dorshimer Date: Tue, 24 Aug 2021 07:08:07 -0400 Subject: [PATCH 1/2] refreshing inputs option --- Source/Core/Core/HotkeyManager.cpp | 1 + Source/Core/Core/HotkeyManager.h | 1 + Source/Core/DolphinWX/Frame.cpp | 13 +++++++++++++ 3 files changed, 15 insertions(+) diff --git a/Source/Core/Core/HotkeyManager.cpp b/Source/Core/Core/HotkeyManager.cpp index 74a0bba052..642c669caa 100644 --- a/Source/Core/Core/HotkeyManager.cpp +++ b/Source/Core/Core/HotkeyManager.cpp @@ -20,6 +20,7 @@ const std::string hotkey_labels[] = { _trans("Toggle OSD chat"), _trans("Send OSD chat message"), _trans("Take Screenshot"), + _trans("Refresh Input Devices"), _trans("Exit"), _trans("Volume Down"), diff --git a/Source/Core/Core/HotkeyManager.h b/Source/Core/Core/HotkeyManager.h index d95d413b9e..2dfb6b57c0 100644 --- a/Source/Core/Core/HotkeyManager.h +++ b/Source/Core/Core/HotkeyManager.h @@ -22,6 +22,7 @@ enum Hotkey HK_SHOW_OSD_CHAT, HK_SEND_CHAT_MSG, HK_SCREENSHOT, + HK_REFRESH_PAD, HK_EXIT, HK_VOLUME_DOWN, diff --git a/Source/Core/DolphinWX/Frame.cpp b/Source/Core/DolphinWX/Frame.cpp index 5da3fd1e9e..2225b743e2 100644 --- a/Source/Core/DolphinWX/Frame.cpp +++ b/Source/Core/DolphinWX/Frame.cpp @@ -1245,6 +1245,17 @@ void CFrame::PollHotkeys(wxTimerEvent &event) } } +static void RefreshInputDevices() { + bool was_unpaused = Core::PauseAndLock(true); + + Wiimote::LoadConfig(); + Keyboard::LoadConfig(); + Pad::LoadConfig(); + HotkeyManagerEmu::LoadConfig(); + + Core::PauseAndLock(false, was_unpaused); +} + void CFrame::ParseHotkeys() { for (int i = 0; i < NUM_HOTKEYS; i++) @@ -1323,6 +1334,8 @@ void CFrame::ParseHotkeys() Core::SaveScreenShot(); if (IsHotkey(HK_EXIT)) wxPostEvent(this, wxCommandEvent(wxEVT_MENU, wxID_EXIT)); + if (IsHotkey(HK_REFRESH_PAD)) + RefreshInputDevices(); if (IsHotkey(HK_VOLUME_DOWN)) AudioCommon::DecreaseVolume(3); if (IsHotkey(HK_VOLUME_UP)) From 7725d5fb0cae6911d093a444a59a238649784ec8 Mon Sep 17 00:00:00 2001 From: Natalie Dorshimer Date: Tue, 24 Aug 2021 17:26:53 -0400 Subject: [PATCH 2/2] make naming more explicit --- Source/Core/Core/HotkeyManager.cpp | 2 +- Source/Core/Core/HotkeyManager.h | 2 +- Source/Core/DolphinWX/Frame.cpp | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Source/Core/Core/HotkeyManager.cpp b/Source/Core/Core/HotkeyManager.cpp index 642c669caa..ff1fc16d87 100644 --- a/Source/Core/Core/HotkeyManager.cpp +++ b/Source/Core/Core/HotkeyManager.cpp @@ -20,7 +20,7 @@ const std::string hotkey_labels[] = { _trans("Toggle OSD chat"), _trans("Send OSD chat message"), _trans("Take Screenshot"), - _trans("Refresh Input Devices"), + _trans("Refresh Input Configuration"), _trans("Exit"), _trans("Volume Down"), diff --git a/Source/Core/Core/HotkeyManager.h b/Source/Core/Core/HotkeyManager.h index 2dfb6b57c0..9a48fb6923 100644 --- a/Source/Core/Core/HotkeyManager.h +++ b/Source/Core/Core/HotkeyManager.h @@ -22,7 +22,7 @@ enum Hotkey HK_SHOW_OSD_CHAT, HK_SEND_CHAT_MSG, HK_SCREENSHOT, - HK_REFRESH_PAD, + HK_REFRESH_INPUT_CONFIG, HK_EXIT, HK_VOLUME_DOWN, diff --git a/Source/Core/DolphinWX/Frame.cpp b/Source/Core/DolphinWX/Frame.cpp index 2225b743e2..a76fe596ec 100644 --- a/Source/Core/DolphinWX/Frame.cpp +++ b/Source/Core/DolphinWX/Frame.cpp @@ -1245,7 +1245,7 @@ void CFrame::PollHotkeys(wxTimerEvent &event) } } -static void RefreshInputDevices() { +static void RefreshInputConfig() { bool was_unpaused = Core::PauseAndLock(true); Wiimote::LoadConfig(); @@ -1334,8 +1334,8 @@ void CFrame::ParseHotkeys() Core::SaveScreenShot(); if (IsHotkey(HK_EXIT)) wxPostEvent(this, wxCommandEvent(wxEVT_MENU, wxID_EXIT)); - if (IsHotkey(HK_REFRESH_PAD)) - RefreshInputDevices(); + if (IsHotkey(HK_REFRESH_INPUT_CONFIG)) + RefreshInputConfig(); if (IsHotkey(HK_VOLUME_DOWN)) AudioCommon::DecreaseVolume(3); if (IsHotkey(HK_VOLUME_UP))