Apply suggestions from review (hasFiveWay)

pull/11749/head
SomeGuy 3 weeks ago committed by GitHub
parent dc0e40150f
commit e8452b5aaa
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -61,7 +61,7 @@ function ReaderBookmark:onGesture() end
function ReaderBookmark:registerKeyEvents()
if Device:hasKeyboard() then
self.key_events.ShowBookmark = { { "B" } }
elseif Device:useDPadAsExtraButtons() then
elseif Device:hasFiveWay() then
self.key_events.ShowBookmark = { { "ScreenKB", "Left" } }
self.key_events.ToggleBookmark = { { "ScreenKB", "Right" } }
end

@ -246,7 +246,7 @@ function ReaderHighlight:registerKeyEvents()
self.key_events.QuickLeftHighlightIndicator = { { "Shift", "Left" }, event = "MoveHighlightIndicator", args = {-1, 0, QUICK_INDICATOR_MOVE} }
self.key_events.QuickRightHighlightIndicator = { { "Shift", "Right" }, event = "MoveHighlightIndicator", args = {1, 0, QUICK_INDICATOR_MOVE} }
self.key_events.StartHighlightIndicator = { { "H" } }
elseif Device:useDPadAsExtraButtons() then
elseif Device:hasFiveWay() then
local QUICK_INDICATOR_MOVE = true
self.key_events.QuickUpHighlightIndicator = { { "ScreenKB", "Up" }, event = "MoveHighlightIndicator", args = {0, -1, QUICK_INDICATOR_MOVE} }
self.key_events.QuickDownHighlightIndicator = { { "ScreenKB", "Down" }, event = "MoveHighlightIndicator", args = {0, 1, QUICK_INDICATOR_MOVE} }

@ -51,7 +51,7 @@ end
function ReaderPaging:onGesture() end
function ReaderPaging:registerKeyEvents()
if Device:hasPageUpDownKeys() and Device:hasDPad() then
if Device:hasFiveWay() then
-- this targets all devices (kindles) non-touch with dPads (i.e dx, kk, k4 and others)
self.key_events.GotoNextPos = {
{ { "RPgFwd", "LPgFwd" } },
@ -100,7 +100,7 @@ function ReaderPaging:registerKeyEvents()
}
end
--[[ upcoming
if Device:useDPadAsExtraButtons() then
if Device:hasFiveWay() and not Device:hasKeyboard() then
-- targets exclusively kindle 4
self.key_events.PrevDocument = {
{ "ScreenKB", "Back" },

@ -116,7 +116,7 @@ end
function ReaderRolling:onGesture() end
function ReaderRolling:registerKeyEvents()
if Device:hasPageUpDownKeys() and Device:hasDPad() then
if Device:hasFiveWay() then
-- targetting all non-touch kindles
self.key_events.GotoNextView = {
{ { "RPgFwd", "LPgFwd" } },
@ -140,7 +140,7 @@ function ReaderRolling:registerKeyEvents()
args = -1,
}
end
if Device:hasPageUpDownKeys() and Device:hasDPad() then
if Device:hasFiveWay() then
self.key_events.ContentSelection = {
{ { "Up", "Down" } },
event = "ContentSelection",
@ -168,7 +168,7 @@ function ReaderRolling:registerKeyEvents()
}
end
--[[ upcoming
if Device:useDPadAsExtraButtons() then
if Device:hasFiveWay() and not Device:hasKeyboard() then
self.key_events.PrevDocument = {
{ "ScreenKB", "Back" },
event = "PrevDocument",

@ -62,7 +62,7 @@ function ReaderToc:onGesture() end
function ReaderToc:registerKeyEvents()
if Device:hasKeyboard() then
self.key_events.ShowToc = { { "T" } }
elseif Device:useDPadAsExtraButtons() then
elseif Device:hasFiveWay() then
self.key_events.ShowToc = { { "ScreenKB", "Up" } }
end
end

@ -41,10 +41,9 @@ local Device = {
hasAuxBattery = no,
hasKeyboard = no,
hasKeys = no,
hasPageUpDownKeys = no,
hasFiveWay = no,
canKeyRepeat = no,
hasDPad = no,
useDPadAsExtraButtons = no,
hasExitOptions = yes,
hasFewKeys = no,
hasWifiToggle = yes,
@ -233,10 +232,6 @@ function Device:init()
end
end
if not Device:hasKeyboard() and Device:hasDPad() and Device:hasPageUpDownKeys() then
self.useDPadAsExtraButtons = yes
end
if self:hasGSensor() then
-- Setup our standard gyro event handler (EV_MSC:MSC_GYRO)
if G_reader_settings:nilOrFalse("input_ignore_gsensor") then

@ -458,7 +458,7 @@ local Kindle2 = Kindle:extend{
isREAGL = no,
hasKeyboard = yes,
hasKeys = yes,
hasPageUpDownKeys = yes,
hasFiveWay = yes,
hasDPad = yes,
canHWInvert = no,
canModifyFBInfo = no,
@ -472,7 +472,7 @@ local KindleDXG = Kindle:extend{
isREAGL = no,
hasKeyboard = yes,
hasKeys = yes,
hasPageUpDownKeys = yes,
hasFiveWay = yes,
hasDPad = yes,
canHWInvert = no,
canModifyFBInfo = no,
@ -486,7 +486,7 @@ local Kindle3 = Kindle:extend{
isREAGL = no,
hasKeyboard = yes,
hasKeys = yes,
hasPageUpDownKeys = yes,
hasFiveWay = yes,
hasDPad = yes,
canHWInvert = no,
canModifyFBInfo = no,
@ -498,7 +498,7 @@ local Kindle4 = Kindle:extend{
model = "Kindle4",
isREAGL = no,
hasKeys = yes,
hasPageUpDownKeys = yes,
hasFiveWay = yes,
hasDPad = yes,
canHWInvert = no,
canModifyFBInfo = no,
@ -547,7 +547,6 @@ local KindleVoyage = Kindle:extend{
canTurnFrontlightOff = no,
hasLightSensor = yes,
hasKeys = yes,
hasPageUpDownKeys = yes,
display_dpi = 300,
touch_dev = "/dev/input/event1",
}
@ -566,7 +565,6 @@ local KindleOasis = Kindle:extend{
isTouchDevice = yes,
hasFrontlight = yes,
hasKeys = yes,
hasPageUpDownKeys = yes,
hasGSensor = yes,
display_dpi = 300,
--[[
@ -585,7 +583,6 @@ local KindleOasis2 = Kindle:extend{
hasFrontlight = yes,
hasLightSensor = yes,
hasKeys = yes,
hasPageUpDownKeys = yes,
hasGSensor = yes,
display_dpi = 300,
touch_dev = "/dev/input/by-path/platform-30a30000.i2c-event",
@ -600,7 +597,6 @@ local KindleOasis3 = Kindle:extend{
hasNaturalLightMixer = yes,
hasLightSensor = yes,
hasKeys = yes,
hasPageUpDownKeys = yes,
hasGSensor = yes,
display_dpi = 300,
touch_dev = "/dev/input/by-path/platform-30a30000.i2c-event",

Loading…
Cancel
Save