summaryrefslogtreecommitdiff
path: root/Source/Core/DolphinWX/ControllerConfigDiag.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/ControllerConfigDiag.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/ControllerConfigDiag.cpp')
-rw-r--r--Source/Core/DolphinWX/ControllerConfigDiag.cpp53
1 files changed, 9 insertions, 44 deletions
diff --git a/Source/Core/DolphinWX/ControllerConfigDiag.cpp b/Source/Core/DolphinWX/ControllerConfigDiag.cpp
index 909f70b1b1..6f3ae906f5 100644
--- a/Source/Core/DolphinWX/ControllerConfigDiag.cpp
+++ b/Source/Core/DolphinWX/ControllerConfigDiag.cpp
@@ -23,6 +23,7 @@
#include "Common/SysConf.h"
#include "Core/ConfigManager.h"
#include "Core/Core.h"
+#include "Core/HotkeyManager.h"
#include "Core/Movie.h"
#include "Core/NetPlayProto.h"
#include "Core/HW/GCKeyboard.h"
@@ -207,12 +208,13 @@ wxStaticBoxSizer* ControllerConfigDiag::CreateWiimoteConfigSizer()
wiimote_configure_bt[i]->Bind(wxEVT_BUTTON, &ControllerConfigDiag::ConfigEmulatedWiimote, this);
// Disable controller type selection for certain circumstances.
- if (NetPlay::IsNetPlayRunning() || Movie::IsMovieActive())
+ bool wii_game_started = SConfig::GetInstance().m_LocalCoreStartupParameter.bWii || Core::GetState() == Core::CORE_UNINITIALIZED;
+ if (NetPlay::IsNetPlayRunning() || Movie::IsMovieActive() || !wii_game_started)
wiimote_source_ch[i]->Disable();
m_orig_wiimote_sources[i] = g_wiimote_sources[i];
wiimote_source_ch[i]->Select(m_orig_wiimote_sources[i]);
- if (m_orig_wiimote_sources[i] != WIIMOTE_SRC_EMU && m_orig_wiimote_sources[i] != WIIMOTE_SRC_HYBRID)
+ if (!wii_game_started || (m_orig_wiimote_sources[i] != WIIMOTE_SRC_EMU && m_orig_wiimote_sources[i] != WIIMOTE_SRC_HYBRID))
wiimote_configure_bt[i]->Disable();
}
@@ -390,28 +392,13 @@ wxStaticBoxSizer* ControllerConfigDiag::CreateGeneralWiimoteSettingsSizer()
void ControllerConfigDiag::ConfigEmulatedWiimote(wxCommandEvent& ev)
{
InputConfig* const wiimote_plugin = Wiimote::GetConfig();
- bool was_init = false;
- if (g_controller_interface.IsInit()) // check if game is running
- {
- was_init = true;
- }
- else
- {
-#if defined(HAVE_X11) && HAVE_X11
- Window win = X11Utils::XWindowFromHandle(GetHandle());
- Wiimote::Initialize(reinterpret_cast<void*>(win));
-#else
- Wiimote::Initialize(reinterpret_cast<void*>(GetHandle()));
-#endif
- }
+
+ HotkeyManagerEmu::Enable(false);
InputConfigDialog m_ConfigFrame(this, *wiimote_plugin, _("Dolphin Emulated Wiimote Configuration"), m_wiimote_index_from_conf_bt_id[ev.GetId()]);
m_ConfigFrame.ShowModal();
- if (!was_init) // if game isn't running
- {
- Wiimote::Shutdown();
- }
+ HotkeyManagerEmu::Enable(true);
}
void ControllerConfigDiag::RefreshRealWiimotes(wxCommandEvent&)
@@ -535,24 +522,7 @@ void ControllerConfigDiag::OnGameCubeConfigButton(wxCommandEvent& event)
InputConfig* const key_plugin = Keyboard::GetConfig();
const int port_num = m_gc_port_config_ids[event.GetId()];
- bool was_init = false;
-
- // check if game is running
- if (g_controller_interface.IsInit())
- {
- was_init = true;
- }
- else
- {
-#if defined(HAVE_X11) && HAVE_X11
- Window win = X11Utils::XWindowFromHandle(GetHandle());
- Pad::Initialize(reinterpret_cast<void*>(win));
- Keyboard::Initialize(reinterpret_cast<void*>(win));
-#else
- Pad::Initialize(reinterpret_cast<void*>(GetHandle()));
- Keyboard::Initialize(reinterpret_cast<void*>(GetHandle()));
-#endif
- }
+ HotkeyManagerEmu::Enable(false);
if (SConfig::GetInstance().m_SIDevice[port_num] == SIDEVICE_GC_KEYBOARD)
{
@@ -565,10 +535,5 @@ void ControllerConfigDiag::OnGameCubeConfigButton(wxCommandEvent& event)
m_ConfigFrame.ShowModal();
}
- // if game isn't running
- if (!was_init)
- {
- Keyboard::Shutdown();
- Pad::Shutdown();
- }
+ HotkeyManagerEmu::Enable(true);
}