set foucus of button table only if the device has a dpad

so that Kindle Voyage won't show a highlighted button in
confirm dialog.
pull/1647/head
chrox 9 years ago
parent ddc36198ba
commit e91b7bd266

@ -9,6 +9,7 @@ local Device = Generic:new{
isEmulator = yes, isEmulator = yes,
hasKeyboard = yes, hasKeyboard = yes,
hasKeys = yes, hasKeys = yes,
hasDPad = yes,
hasFrontlight = yes, hasFrontlight = yes,
isTouchDevice = yes, isTouchDevice = yes,
} }

@ -16,6 +16,7 @@ local Device = {
-- hardware feature tests: (these are functions!) -- hardware feature tests: (these are functions!)
hasKeyboard = no, hasKeyboard = no,
hasKeys = no, hasKeys = no,
hasDPad = no,
isTouchDevice = no, isTouchDevice = no,
hasFrontlight = no, hasFrontlight = no,

@ -12,23 +12,27 @@ local Kindle2 = Kindle:new{
model = "Kindle2", model = "Kindle2",
hasKeyboard = yes, hasKeyboard = yes,
hasKeys = yes, hasKeys = yes,
hasDPad = yes,
} }
local KindleDXG = Kindle:new{ local KindleDXG = Kindle:new{
model = "KindleDXG", model = "KindleDXG",
hasKeyboard = yes, hasKeyboard = yes,
hasKeys = yes, hasKeys = yes,
hasDPad = yes,
} }
local Kindle3 = Kindle:new{ local Kindle3 = Kindle:new{
model = "Kindle3", model = "Kindle3",
hasKeyboard = yes, hasKeyboard = yes,
hasKeys = yes, hasKeys = yes,
hasDPad = yes,
} }
local Kindle4 = Kindle:new{ local Kindle4 = Kindle:new{
model = "Kindle4", model = "Kindle4",
hasKeys = yes, hasKeys = yes,
hasDPad = yes,
} }
local KindleTouch = Kindle:new{ local KindleTouch = Kindle:new{

@ -68,7 +68,7 @@ function ButtonTable:init()
self:addHorizontalSep() self:addHorizontalSep()
end end
end -- end for each button line end -- end for each button line
if Device:hasKeys() then if Device:hasDPad() then
self.layout = self.buttons self.layout = self.buttons
self.layout[1][1]:onFocus() self.layout[1][1]:onFocus()
self.key_events.SelectByKeyPress = { {{"Press", "Enter"}} } self.key_events.SelectByKeyPress = { {{"Press", "Enter"}} }

Loading…
Cancel
Save