diff --git a/Themes/_fallback/Scripts/04 KeymapGuard.lua b/Themes/_fallback/Scripts/04 KeymapGuard.lua index e0178f930f..a5b820f42b 100644 --- a/Themes/_fallback/Scripts/04 KeymapGuard.lua +++ b/Themes/_fallback/Scripts/04 KeymapGuard.lua @@ -1,19 +1,24 @@ ---People sometimes have problems where they rebind the enter key and thus cannot press start. ---To work around this problem, this script deletes every key binding to Enter. - ---load Keymaps.ini -local keymaps = IniFile.ReadFile("/Save/Keymaps.ini") - ---iterate through the games -for k,v in keymaps do - --iterate through the potential key mappings - for l,w in v do - --check for enter - w:gsub("Key_enter","") - --write back - keymaps[k][l] = w - end -end - ---write Keymaps.ini back out. yay. -IniFile.WriteFile("/Save/Keymaps.ini",keymaps) \ No newline at end of file +--People sometimes have problems where they rebind the enter key and thus cannot press start. +--To work around this problem, this script deletes every key binding to Enter. + +function ClearEnterMappedKeys() + --load Keymaps.ini +local keymaps = IniFile.ReadFile("/Save/Keymaps.ini") + +--iterate through the games +for k,v in keymaps do + --iterate through the potential key mappings + for l,w in v do + --check for enter + w:gsub("Key_enter","") + --write back + keymaps[k][l] = w + end +end + +--write Keymaps.ini back out. yay. +IniFile.WriteFile("/Save/Keymaps.ini",keymaps) +end + +--actually run it. +ClearEnterMappedKeys() \ No newline at end of file