format this better

This commit is contained in:
AJ Kelly
2011-12-29 11:26:20 -06:00
parent 68bd6bab4a
commit d1decd52a1
+18 -17
View File
@@ -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()