void ControllerConfigDiag::OnGameCubeConfigButton(wxCommandEvent& event)
{
    InputConfig* const pad_plugin = Pad::GetConfig();
    InputConfig* const key_plugin = Keyboard::GetConfig();
    const int port_num = m_gc_port_config_ids[event.GetId()];

    HotkeyManagerEmu::Enable(false);

    if (SConfig::GetInstance().m_SIDevice[port_num] == SIDEVICE_GC_KEYBOARD)
    {
        InputConfigDialog m_ConfigFrame(this, *key_plugin, _("GameCube Controller Configuration"),
                                        port_num);
        m_ConfigFrame.ShowModal();
    }
    else if (SConfig::GetInstance().m_SIDevice[port_num] == SIDEVICE_WIIU_ADAPTER)
    {
        GCAdapterConfigDiag m_ConfigFramg(this, _("Wii U Gamecube Controller Adapter Configuration"),
                                          port_num);
        m_ConfigFramg.ShowModal();
    }
    else
    {
        InputConfigDialog m_ConfigFrame(this, *pad_plugin, _("GameCube Controller Configuration"),
                                        port_num);
        m_ConfigFrame.ShowModal();
    }

    HotkeyManagerEmu::Enable(true);
}
void CFrame::OnConfigHotkey(wxCommandEvent& WXUNUSED(event))
{
  InputConfig* const hotkey_plugin = HotkeyManagerEmu::GetConfig();

  // check if game is running
  bool game_running = false;
  if (Core::GetState() == Core::CORE_RUN)
  {
    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
  Wiimote::LoadConfig();
  Keyboard::LoadConfig();
  Pad::LoadConfig();
  HotkeyManagerEmu::LoadConfig();

  HotkeyManagerEmu::Enable(true);

  // if game isn't running
  if (game_running)
  {
    Core::SetState(Core::CORE_RUN);
  }

  // Update the GUI in case menu accelerators were changed
  UpdateGUI();
}
void InterfaceConfigPane::OnHotkeyConfigButtonClicked(wxCommandEvent& event)
{
	bool was_init = false;

	InputConfig* const hotkey_plugin = HotkeyManagerEmu::GetConfig();

	// 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());
		HotkeyManagerEmu::Initialize(reinterpret_cast<void*>(win));
#else
		HotkeyManagerEmu::Initialize(reinterpret_cast<void*>(GetHandle()));
#endif
	}

	InputConfigDialog m_ConfigFrame(this, *hotkey_plugin, _("Dolphin Hotkeys"));
	m_ConfigFrame.ShowModal();

	// if game isn't running
	if (!was_init)
		HotkeyManagerEmu::Shutdown();

	// Update the GUI in case menu accelerators were changed
	main_frame->UpdateGUI();
}
void ControllerConfigDiag::ConfigEmulatedWiimote(wxCommandEvent& ev)
{
	InputConfig* const wiimote_plugin = Wiimote::GetConfig();

	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();

	HotkeyManagerEmu::Enable(true);
}