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
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
HotkeyConfigDialog(wxWindow *parent,
|
|
|
|
wxWindowID id = 1,
|
2011-01-05 04:35:46 +00:00
|
|
|
const wxString &title = _("Hotkey Configuration"),
|
2010-04-12 01:56:05 +00:00
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
2011-03-15 13:38:52 +00:00
|
|
|
long style = wxDEFAULT_DIALOG_STYLE);
|
2010-04-12 01:56:05 +00:00
|
|
|
virtual ~HotkeyConfigDialog();
|
|
|
|
|
|
|
|
private:
|
|
|
|
DECLARE_EVENT_TABLE();
|
|
|
|
|
|
|
|
wxString OldLabel;
|
|
|
|
|
2014-09-01 17:44:16 +00:00
|
|
|
wxButton *ClickedButton;
|
|
|
|
wxButton *m_Button_Hotkeys[NUM_HOTKEYS];
|
2011-03-15 13:38:52 +00:00
|
|
|
|
2014-09-01 17:44:16 +00:00
|
|
|
wxTimer m_ButtonMappingTimer;
|
2010-04-12 01:56:05 +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);
|
2014-08-30 16:41:21 +00:00
|
|
|
void CreateHotkeyGUIControls();
|
2010-04-12 01:56:05 +00:00
|
|
|
|
|
|
|
void SetButtonText(int id, const wxString &keystr, const wxString &modkeystr = wxString());
|
|
|
|
|
|
|
|
void DoGetButtons(int id);
|
2014-08-30 16:41:21 +00:00
|
|
|
void EndGetButtons();
|
2010-04-12 01:56:05 +00:00
|
|
|
|
|
|
|
int GetButtonWaitingID, GetButtonWaitingTimer, g_Pressed, g_Modkey;
|
|
|
|
};
|