-
Notifications
You must be signed in to change notification settings - Fork 6
/
main.lua
33 lines (28 loc) · 805 Bytes
/
main.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
require "keybindings"
require "modes"
f = {}
function initUi()
index = 1
for _, binding in pairs(keybindings) do
for _, button in pairs(binding.buttons) do
for _, validMode in pairs(binding.modes) do
declaration = "f" .. tostring(index)
.. " = function () handle(\""
.. button
.. "\") end"
defineFunction = load(declaration)
defineFunction()
app.registerUi({
["menu"] = binding.description .. " (" .. validMode .. " mode)",
-- this doesn't work
["callback"] = "f" .. tostring(index),
["accelerator"] = button
})
index = index + 1
end
end
end
end
currentMode = "tool"
lastPage = 1
sticky = false