Files
itgmania212121/Themes/_fallback/Scripts/04 KeymapGuard.lua
T

25 lines
652 B
Lua
Raw Normal View History

2011-12-29 11:26:20 -06:00
--[[ 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. --]]
2011-12-03 03:38:51 +00:00
function ClearEnterMappedKeys()
2011-12-29 11:26:20 -06:00
-- load Keymaps.ini
local keymaps = IniFile.ReadFile("/Save/Keymaps.ini")
2011-12-03 03:38:51 +00:00
2011-12-29 11:26:20 -06:00
-- 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
2011-12-03 03:38:51 +00:00
end
2011-12-29 11:26:20 -06:00
-- write Keymaps.ini back out. yay.
IniFile.WriteFile("/Save/Keymaps.ini",keymaps)
2011-12-03 03:38:51 +00:00
end
2011-12-29 11:26:20 -06:00
-- actually run it.
2011-12-03 03:38:51 +00:00
ClearEnterMappedKeys()