1 -- Authors: Sadrul Habib Chowdhury <imadil@gmail.com>, Canaan Hadley-Voth
2 -- License: Public domain
3 -- Last Changed: Unknown
7 -- Switch between different set of keybindings. You can use it to temporarily
8 -- disable the keybindings by pressing META+F8. All the subsequent keystrokes
9 -- will be sent to the application, until you press META+F8 again, at which
10 -- point the previous bindings will be restored.
12 -- Author: Sadrul Habib Chowdhury (Adil) <imadil |at| gmail |dot| com>
13 -- Adjustments by: Canaan Hadley-Voth
17 -- second set of bindings
21 kpress(META
.."F8", "toggle_bindings()"),
25 function toggle_bindings()
26 local save
= table.copy(ioncore
.getbindings(), true)
29 -- First empty all the bindings
30 for name
, bindings
in pairs(save
) do
31 for index
, bind
in pairs(bindings
) do
33 kcb_area
= bind
.kcb
.."@"..bind
.area
37 -- This can most definitely be improved
38 if bind
.action
== "kpress" then
39 ioncore
.defbindings(name
, {kpress(bind
.kcb
, nil)})
40 -- "kpress_wairel" appearing as bind.action
41 elseif string.find(bind
.action
, "kpress_wai") then
42 ioncore
.defbindings(name
, {kpress_wait(bind
.kcb
, nil)})
43 elseif bind
.action
== "mpress" then
44 ioncore
.defbindings(name
, {mpress(kcb_area
, nil)})
45 elseif bind
.action
== "mdrag" then
46 ioncore
.defbindings(name
, {mdrag(kcb_area
, nil)})
47 elseif bind
.action
== "mclick" then
48 ioncore
.defbindings(name
, {mclick(kcb_area
, nil)})
49 elseif bind
.action
== "mdblclick" then
50 ioncore
.defbindings(name
, {mdblclick(kcb_area
, nil)})
55 -- Store the last saved on
56 for a
, b
in pairs(alternate
) do
57 ioncore
.defbindings(a
, b
)
63 ioncore
.defbindings("WScreen", {
64 kpress(META
.."F8", "toggle_bindings()"),