2013-04-18 03:43:35 +00:00
|
|
|
// Copyright 2013 Dolphin Emulator Project
|
2015-05-17 23:08:10 +00:00
|
|
|
// Licensed under GPLv2+
|
2013-04-18 03:43:35 +00:00
|
|
|
// 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/dialog.h>
|
2014-09-01 17:44:16 +00:00
|
|
|
#include <wx/timer.h>
|
2014-02-22 22:36:30 +00:00
|
|
|
|
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;
|
|
|
|
|
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
|
|
|
};
|