(svn r20070) -Feature: when none of the open windows handles a keypress, try all toolbars for global hotkeys

Users that have run a version between r20056 and r20068 should delete their hotkeys.cfg to reset the terraform toolbar hotkeys to default
This commit is contained in:
yexo
2010-07-03 21:43:44 +00:00
parent 28945bbfa5
commit d96aa7abfa
9 changed files with 91 additions and 28 deletions

View File

@@ -13,6 +13,7 @@
#define HOTKEYS_H
#include "core/smallvec_type.hpp"
#include "gfx_type.h"
/**
* All data for a single hotkey. The name (for saving/loading a configfile),
@@ -115,7 +116,7 @@ int CheckHotkeyMatch(Hotkey<T> *list, uint16 keycode, T *w, bool global_only = f
{
while (list->num != -1) {
if (list->keycodes.Contains(keycode | WKC_GLOBAL_HOTKEY) || (!global_only && list->keycodes.Contains(keycode))) {
if (list->callback != NULL) (w->*(list->callback->callback))(-1);
if (!global_only && list->callback != NULL) (w->*(list->callback->callback))(-1);
return list->num;
}
list++;
@@ -126,4 +127,7 @@ int CheckHotkeyMatch(Hotkey<T> *list, uint16 keycode, T *w, bool global_only = f
void LoadHotkeysFromConfig();
void SaveHotkeysToConfig();
void HandleGlobalHotkeys(uint16 key, uint16 keycode);
#endif /* HOTKEYS_H */