(svn r25414) -Codechange: Move handling of global hotkeys to HotkeyList.

This commit is contained in:
frosch
2013-06-15 15:31:22 +00:00
parent ee4e68bd5e
commit fef30983e6
11 changed files with 145 additions and 142 deletions

View File

@@ -14,6 +14,7 @@
#include "core/smallvec_type.hpp"
#include "gfx_type.h"
#include "window_type.h"
/**
* All data for a single hotkey. The name (for saving/loading a configfile),
@@ -38,7 +39,9 @@ struct IniFile;
* List of hotkeys for a window.
*/
struct HotkeyList {
HotkeyList(const char *ini_group, Hotkey *items);
typedef EventState (*GlobalHotkeyHandlerFunc)(int hotkey);
HotkeyList(const char *ini_group, Hotkey *items, GlobalHotkeyHandlerFunc global_hotkey_handler = NULL);
~HotkeyList();
void Load(IniFile *ini);
@@ -46,6 +49,7 @@ struct HotkeyList {
int CheckMatch(uint16 keycode, bool global_only = false) const;
GlobalHotkeyHandlerFunc global_hotkey_handler;
private:
const char *ini_group;
Hotkey *items;