From cbbed0f18b38b5b43272570a45335b794f77b166 Mon Sep 17 00:00:00 2001 From: danieru Date: Sat, 20 Apr 2013 13:01:15 -0600 Subject: [PATCH] Implement platform specific keymap registration --- Common/KeyMap.cpp | 15 ++++++++++++++- Common/KeyMap.h | 1 + 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/Common/KeyMap.cpp b/Common/KeyMap.cpp index 81bcc54b31..b3bc09c164 100644 --- a/Common/KeyMap.cpp +++ b/Common/KeyMap.cpp @@ -282,4 +282,17 @@ static int KeyMap::SetKeyMapping(KeyMap::Key key, int btn) g_Config.iMappingMap[key] = btn; } -// TODO: implement RegisterPlatformDefaultKeyMap() +static int KeyMap::RegisterPlatformDefaultKeyMap(std::map *overriding_map) +{ + if (overriding_map == NULL) + return 1; + platform_keymap = overriding_map; + return 0; +} + +static void KeyMap::DeregisterPlatformDefaultKeyMap(void) +{ + platform_keymap = NULL; + return; +} + diff --git a/Common/KeyMap.h b/Common/KeyMap.h index 76d0f3c0b5..2d10d140de 100644 --- a/Common/KeyMap.h +++ b/Common/KeyMap.h @@ -185,5 +185,6 @@ namespace KeyMap { * Any buttons missing will * fallback to KeyMap's keymap. */ static int RegisterPlatformDefaultKeyMap(std::map *); + static void DeregisterPlatformDefaultKeyMap(void); }