peripheral overhaul

This commit is contained in:
kepler155c@gmail.com
2018-01-06 22:25:33 -05:00
parent 911fec9118
commit 13ec8ea04f
7 changed files with 49 additions and 27 deletions

View File

@@ -1600,7 +1600,9 @@ function UI.Grid:setPage(pageNo)
end
function UI.Grid:eventHandler(event)
if event.type == 'mouse_click' or event.type == 'mouse_doubleclick' then
if event.type == 'mouse_click' or
event.type == 'mouse_rightclick' or
event.type == 'mouse_doubleclick' then
if not self.disableHeader then
if event.y == 1 then
local col = 2
@@ -1628,6 +1630,8 @@ function UI.Grid:eventHandler(event)
self:setIndex(row)
if event.type == 'mouse_doubleclick' then
self:emit({ type = 'key_enter' })
elseif event.type == 'mouse_rightclick' then
self:emit({ type = 'grid_select_right', selected = self.selected, element = self })
end
return true
end