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); }