awful: add support for Home and End keys

Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
Julien Danjou 2008-06-18 20:39:35 +02:00
parent dcbe24b521
commit 25a65cc2f3
1 changed files with 5 additions and 1 deletions

View File

@ -610,7 +610,11 @@ local function menu(args, textbox, exe_callback, completion_callback)
end
-- Typin cases
if key == "BackSpace" then
if key == "Home" then
cur_pos = 1
elseif key == "End" then
cur_pos = #command + 1
elseif key == "BackSpace" then
if cur_pos > 1 then
command = command:sub(1, cur_pos - 2) .. command:sub(cur_pos)
cur_pos = cur_pos - 1