2013-04-18 03:43:35 +00:00
|
|
|
// Copyright 2013 Dolphin Emulator Project
|
|
|
|
// Licensed under GPLv2
|
|
|
|
// Refer to the license.txt file included.
|
2010-04-12 01:56:05 +00:00
|
|
|
|
2014-02-10 18:54:46 +00:00
|
|
|
#pragma once
|
2010-04-12 01:56:05 +00:00
|
|
|
|
2014-02-22 22:36:30 +00:00
|
|
|
#include <wx/defs.h>
|
|
|
|
#include <wx/dialog.h>
|
|
|
|
#include <wx/event.h>
|
|
|
|
#include <wx/gdicmn.h>
|
|
|
|
#include <wx/string.h>
|
2014-09-01 17:44:16 +00:00
|
|
|
#include <wx/timer.h>
|
2014-02-22 22:36:30 +00:00
|
|
|
#include <wx/translation.h>
|
|
|
|
#include <wx/windowid.h>
|
|
|
|
|
2014-02-17 10:18:15 +00:00
|
|
|
#include "Core/CoreParameter.h"
|
2010-04-12 01:56:05 +00:00
|
|
|
|
|
|
|
#if defined(HAVE_X11) && HAVE_X11
|
|
|
|
#include <X11/Xlib.h>
|
|
|
|
#include <X11/keysym.h>
|
|
|
|
#endif
|
|
|
|
|
2014-02-22 22:36:30 +00:00
|
|
|
class wxButton;
|
|
|
|
class wxTimerEvent;
|
|
|
|
class wxWindow;
|
|
|
|
|
2010-04-12 01:56:05 +00:00
|
|
|
class HotkeyConfigDialog : public wxDialog
|
|
|
|
{
|
2014-11-09 00:26:20 +00:00
|
|
|
public:
|
|
|
|
HotkeyConfigDialog(wxWindow* parent,
|
2014-12-02 03:56:18 +00:00
|
|
|
wxWindowID id = wxID_ANY,
|
2015-03-06 00:54:29 +00:00
|
|
|
const wxString &title = _("Key Shortcuts"),
|
2014-11-09 00:26:20 +00:00
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
|
|
|
long style = wxDEFAULT_DIALOG_STYLE);
|
|
|
|
virtual ~HotkeyConfigDialog();
|
2010-04-12 01:56:05 +00:00
|
|
|
|
2014-11-09 00:26:20 +00:00
|
|
|
private:
|
|
|
|
wxString OldLabel;
|
2010-04-12 01:56:05 +00:00
|
|
|
|
2014-11-09 00:26:20 +00:00
|
|
|
wxButton* ClickedButton;
|
|
|
|
wxButton* m_Button_Hotkeys[NUM_HOTKEYS];
|
2010-04-12 01:56:05 +00:00
|
|
|
|
2014-11-09 00:26:20 +00:00
|
|
|
wxTimer m_ButtonMappingTimer;
|
2011-03-15 13:38:52 +00:00
|
|
|
|
2014-11-09 00:26:20 +00:00
|
|
|
void OnButtonTimer(wxTimerEvent& WXUNUSED(event)) { DoGetButtons(GetButtonWaitingID); }
|
|
|
|
void OnButtonClick(wxCommandEvent& event);
|
|
|
|
void OnKeyDown(wxKeyEvent& event);
|
|
|
|
void SaveButtonMapping(int Id, int Key, int Modkey);
|
|
|
|
void CreateHotkeyGUIControls();
|
2010-04-12 01:56:05 +00:00
|
|
|
|
2014-11-09 00:26:20 +00:00
|
|
|
void SetButtonText(int id, const wxString &keystr, const wxString &modkeystr = wxString());
|
2010-04-12 01:56:05 +00:00
|
|
|
|
2014-11-09 00:26:20 +00:00
|
|
|
void DoGetButtons(int id);
|
|
|
|
void EndGetButtons();
|
2010-04-12 01:56:05 +00:00
|
|
|
|
2014-11-09 00:26:20 +00:00
|
|
|
int GetButtonWaitingID, GetButtonWaitingTimer, g_Pressed, g_Modkey;
|
2010-04-12 01:56:05 +00:00
|
|
|
};
|