Skip to content

Instantly share code, notes, and snippets.

@dylanwh
Created May 17, 2009 02:14
Show Gist options
  • Save dylanwh/112892 to your computer and use it in GitHub Desktop.
Save dylanwh/112892 to your computer and use it in GitHub Desktop.
local keybuf = ""
function process(key)
keybuf = keybuf .. key
if is_prefix(keybuf) then
-- do nothing
elseif is_complete(keybuf) then
local func = lookup(keybuf)
keybuf = ""
func()
else
keybuf = "" -- or type out?
screen:keypress(key)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment