From: karim hamidou Date: Sun, 13 Jul 2014 10:03:31 +0000 (+0200) Subject: basic command mode X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=26762fbd8e8e170662ae63c4512df46c4cf54d06;p=vice.git basic command mode --- diff --git a/main.lua b/main.lua index cc30114..b10b866 100644 --- a/main.lua +++ b/main.lua @@ -1,4 +1,16 @@ -function keyboard_event_handler (keycode) - display(get_cursor_position()) - io.write("Hello world, from ",keycode,"!\n") +command_mode = true +display("--COMMAND--") + +command_buffer = "" + +function keyboard_event_handler (keyname) + io.write(keyname, "\n") + if command_mode == true then + if keyname == "Return" then + io.write("Full command: ", command_buffer, "\n") + command_buffer = "" + else + command_buffer = command_buffer .. keyname + end + end end