summaryrefslogtreecommitdiff
path: root/Source/Core/DolphinWX/FrameTools.cpp
diff options
context:
space:
mode:
authorskidau <skidau@gmail.com>2015-03-08 20:34:04 +1100
committerskidau <skidau@gmail.com>2015-03-08 20:34:04 +1100
commit61591db916da0ab7c599629b98778efd52016538 (patch)
tree83236d543ffa540871225f297c6f1952ace81f30 /Source/Core/DolphinWX/FrameTools.cpp
parent7216e94823498339a745e9cdf1125320ea9fca86 (diff)
parent3e12787cc8e801c00957f1e5305622ea1eb3423b (diff)
Merge pull request #2011 from skidau/hotkey-render-to-main
Fixed the hotkeys so that they work with Render to Main To set up a mix of keyboard and gamepad hotkeys, follow these steps: 1. In the Hotkey Settings, change the Device to Keyboard 2. Right click the hotkey button that you wish to map to your gamepad 3. In the window that pops up, change the Device to your gamepad 4. Press the Clear button 5. Press Detect and press the button on your gamepad that you want to map 6. Press Select 7. Press OK To map a combo hotkey, e.g. Shift F5, follow these steps 1. Follow steps 1-4 above 2. Press Detect and the modifier button (e.g. Shift) 3. Press Select 4. Press Detect and the button which isn't the modifier (e.g. F5) 5. Press the "& AND" button 6. Press OK This patch fixes these issues: Issue 8307 Issue 8238 Issue 8217 Issue 8216 Issue 8214 Issue 8201 Issue 7652
Diffstat (limited to 'Source/Core/DolphinWX/FrameTools.cpp')
-rw-r--r--Source/Core/DolphinWX/FrameTools.cpp38
1 files changed, 22 insertions, 16 deletions
diff --git a/Source/Core/DolphinWX/FrameTools.cpp b/Source/Core/DolphinWX/FrameTools.cpp
index 5ae3e62076..fda4f4ee0e 100644
--- a/Source/Core/DolphinWX/FrameTools.cpp
+++ b/Source/Core/DolphinWX/FrameTools.cpp
@@ -51,6 +51,7 @@
#include "Core/State.h"
#include "Core/HW/CPU.h"
#include "Core/HW/DVDInterface.h"
+#include "Core/HW/GCKeyboard.h"
#include "Core/HW/GCPad.h"
#include "Core/HW/ProcessorInterface.h"
#include "Core/HW/SI_Device.h"
@@ -238,8 +239,8 @@ wxMenuBar* CFrame::CreateMenu()
pOptionsMenu->Append(IDM_CONFIG_GFX_BACKEND, _("&Graphics Settings"));
pOptionsMenu->Append(IDM_CONFIG_AUDIO, _("&Audio Settings"));
pOptionsMenu->Append(IDM_CONFIG_CONTROLLERS, _("&Controller Settings"));
+ pOptionsMenu->Append(IDM_CONFIG_MENU_COMMANDS, _("&Key Shortcuts"));
pOptionsMenu->Append(IDM_CONFIG_HOTKEYS, _("&Hotkey Settings"));
- pOptionsMenu->Append(IDM_CONFIG_MENU_COMMANDS, _("&Menu Accelerators"));
if (g_pCodeWindow)
{
pOptionsMenu->AppendSeparator();
@@ -686,7 +687,8 @@ void CFrame::BootGame(const std::string& filename)
// Open file to boot
void CFrame::OnOpen(wxCommandEvent& WXUNUSED (event))
{
- DoOpen(true);
+ if (Core::GetState() == Core::CORE_UNINITIALIZED)
+ DoOpen(true);
}
void CFrame::DoOpen(bool Boot)
@@ -1365,27 +1367,31 @@ void CFrame::OnConfigHotkey(wxCommandEvent& WXUNUSED (event))
InputConfig* const hotkey_plugin = HotkeyManagerEmu::GetConfig();
// check if game is running
- if (g_controller_interface.IsInit())
- {
- was_init = true;
- }
- else
+ bool game_running = false;
+ if (Core::GetState() == Core::CORE_RUN)
{
-#if defined(HAVE_X11) && HAVE_X11
- Window win = X11Utils::XWindowFromHandle(GetHandle());
- HotkeyManagerEmu::Initialize(reinterpret_cast<void*>(win));
-#else
- HotkeyManagerEmu::Initialize(reinterpret_cast<void*>(GetHandle()));
-#endif
+ Core::SetState(Core::CORE_PAUSE);
+ game_running = true;
}
+ HotkeyManagerEmu::Enable(false);
+
InputConfigDialog m_ConfigFrame(this, *hotkey_plugin, _("Dolphin Hotkeys"));
m_ConfigFrame.ShowModal();
+ // Update references in case controllers were refreshed
+ if (SConfig::GetInstance().m_LocalCoreStartupParameter.bWii)
+ Wiimote::LoadConfig();
+ Keyboard::LoadConfig();
+ Pad::LoadConfig();
+ HotkeyManagerEmu::LoadConfig();
+
+ HotkeyManagerEmu::Enable(true);
+
// if game isn't running
- if (!was_init)
+ if (game_running)
{
- HotkeyManagerEmu::Shutdown();
+ Core::SetState(Core::CORE_RUN);
}
// Update the GUI in case menu accelerators were changed
@@ -1761,7 +1767,7 @@ void CFrame::UpdateGUI()
GetMenuBar()->FindItem(IDM_SCREENSHOT)->Enable(Running || Paused);
GetMenuBar()->FindItem(IDM_TOGGLE_FULLSCREEN)->Enable(Running || Paused);
- // Update Menu Accelerators
+ // Update Key Shortcuts
for (unsigned int i = 0; i < NUM_HOTKEYS; i++)
{
if (GetCmdForHotkey(i) == -1)