local alternate = { WScreen = { kpress(MOD1.."Z", "toggle_bindings()"), } } function toggle_bindings() local save = table.copy(ioncore.getbindings(), true) local kcb_area for name, bindings in pairs(save) do for index, bind in pairs(bindings) do if bind.area then kcb_area = bind.kcb.."@"..bind.area else kcb_area = bind.kcb end if bind.action == "kpress" then ioncore.defbindings(name, {kpress(bind.kcb, nil)}) elseif string.find(bind.action, "kpress_wai") then ioncore.defbindings(name, {kpress_wait(bind.kcb, nil)}) elseif bind.action == "mpress" then ioncore.defbindings(name, {mpress(kcb_area, nil)}) elseif bind.action == "mdrag" then ioncore.defbindings(name, {mdrag(kcb_area, nil)}) elseif bind.action == "mclick" then ioncore.defbindings(name, {mclick(kcb_area, nil)}) elseif bind.action == "mdblclick" then ioncore.defbindings(name, {mdblclick(kcb_area, nil)}) end end end for a, b in pairs(alternate) do ioncore.defbindings(a, b) end alternate = save end ioncore.defbindings("WScreen", { kpress(META.."Z", "toggle_bindings()"), })