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>
|
|
|
|
#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 wxTimer;
|
|
|
|
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;
|
|
|
|
|
2011-03-15 13:38:52 +00:00
|
|
|
wxButton *ClickedButton,
|
2010-04-12 01:56:05 +00:00
|
|
|
*m_Button_Hotkeys[NUM_HOTKEYS];
|
2011-03-15 13:38:52 +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);
|
|
|
|
void CreateHotkeyGUIControls(void);
|
|
|
|
|
|
|
|
void SetButtonText(int id, const wxString &keystr, const wxString &modkeystr = wxString());
|
|
|
|
|
|
|
|
void DoGetButtons(int id);
|
|
|
|
void EndGetButtons(void);
|
|
|
|
|
|
|
|
int GetButtonWaitingID, GetButtonWaitingTimer, g_Pressed, g_Modkey;
|
|
|
|
};
|