Skip to content

Commit

Permalink
fix tab
Browse files Browse the repository at this point in the history
  • Loading branch information
waruqi committed May 14, 2020
1 parent 0c4666c commit fea4d39
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/ltui/panel.lua
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,11 @@ function panel:first()
return self._VIEWS:first()
end

-- get the last view
function panel:last()
return self._VIEWS:last()
end

-- get the next view
function panel:next(v)
return self._VIEWS:next(v)
Expand Down Expand Up @@ -280,7 +285,10 @@ function panel:on_event(e)

-- select view?
if e.type == event.ev_keyboard then
if e.key_name == "Right" or e.key_name == "Tab" then
-- @note we also use '-' to switch them on termux without right/left and
-- we cannot use tab, because we still need swith views on windows. e.g. inputdialog
-- @see https://github.com/tboox/ltui/issues/11
if e.key_name == "Right" or e.key_name == "-" then
return self:select_next()
elseif e.key_name == "Left" then
return self:select_prev()
Expand Down

0 comments on commit fea4d39

Please sign in to comment.