From d1decd52a17b33cec8e9aef67e9e071ffdce0fcf Mon Sep 17 00:00:00 2001 From: AJ Kelly Date: Thu, 29 Dec 2011 11:26:20 -0600 Subject: [PATCH] format this better --- Themes/_fallback/Scripts/04 KeymapGuard.lua | 35 +++++++++++---------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/Themes/_fallback/Scripts/04 KeymapGuard.lua b/Themes/_fallback/Scripts/04 KeymapGuard.lua index d4ecc14003..aaafecfe2d 100644 --- a/Themes/_fallback/Scripts/04 KeymapGuard.lua +++ b/Themes/_fallback/Scripts/04 KeymapGuard.lua @@ -1,24 +1,25 @@ ---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. +--[[ 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") + -- load Keymaps.ini + local keymaps = IniFile.ReadFile("/Save/Keymaps.ini") ---iterate through the games -for k,v in pairs(keymaps) do - --iterate through the potential key mappings - for l,w in pairs(v) do - --check for enter - w:gsub("Key_enter","") - --write back - keymaps[k][l] = w + -- iterate through the games + for k,v in pairs(keymaps) do + -- iterate through the potential key mappings + for l,w in pairs(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 ---write Keymaps.ini back out. yay. -IniFile.WriteFile("/Save/Keymaps.ini",keymaps) -end - ---actually run it. +-- actually run it. ClearEnterMappedKeys() \ No newline at end of file