Skip to content

Instantly share code, notes, and snippets.

@dylanwh
Created May 17, 2009 04:37
Show Gist options
  • Save dylanwh/112923 to your computer and use it in GitHub Desktop.
Save dylanwh/112923 to your computer and use it in GitHub Desktop.
local make_keyspec = require("moonshine.ui.term").make_keyspec
local Tree = require "moonshine.tree"
local tree = Tree:new()
function M.bind(spec, name)
tree:insert( make_keyspec(spec), name)
end
-- called by on_keypress_raw()
function M.keypress(k)
-- FIXME
-- else
-- on_keypress(k)
-- end
end
function M.invoke(name)
local funcname = "kb_" .. name:gsub("[^a-zA-Z_]", "_")
_G[funcname]()
end
return M
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment