SomeGuy 3 weeks ago committed by GitHub
commit 10a1885a90
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -51,7 +51,38 @@ end
function ReaderPaging:onGesture() end
function ReaderPaging:registerKeyEvents()
if Device:hasKeys() then
if Device:hasPageUpDownKeys() and Device:hasDPad() then
self.key_events.GotoNextPage = {
{ { "RPgFwd", "LPgFwd" } },
event = "GotoViewRel",
args = 1,
}
self.key_events.GotoPrevPage = {
{ { "RPgBack", "LPgBack" } },
event = "GotoViewRel",
args = -1,
}
self.key_events.GotoNextPos = {
{ "Down" },
event = "GotoPosRel",
args = 1,
}
self.key_events.GotoPrevPos = {
{ "Up" },
event = "GotoPosRel",
args = -1,
}
self.key_events.GotoNextChapter = {
{ "Right" },
event = "GotoNextChapter",
args = 1,
}
self.key_events.GotoPrevChapter = {
{ "Left" },
event = "GotoPrevChapter",
args = -1,
}
elseif Device:hasKeys() then
self.key_events.GotoNextPage = {
{ { "RPgFwd", "LPgFwd", not Device:hasFewKeys() and "Right" } },
event = "GotoViewRel",

@ -116,7 +116,18 @@ end
function ReaderRolling:onGesture() end
function ReaderRolling:registerKeyEvents()
if Device:hasKeys() then
if Device:hasPageUpDownKeys() and Device:hasDPad() then
self.key_events.GotoNextView = {
{ { "RPgFwd", "LPgFwd" } },
event = "GotoViewRel",
args = 1,
}
self.key_events.GotoPrevView = {
{ { "RPgBack", "LPgBack" } },
event = "GotoViewRel",
args = -1,
}
elseif Device:hasKeys() then
self.key_events.GotoNextView = {
{ { "RPgFwd", "LPgFwd", "Right" } },
event = "GotoViewRel",
@ -128,7 +139,22 @@ function ReaderRolling:registerKeyEvents()
args = -1,
}
end
if Device:hasDPad() then
if Device:hasPageUpDownKeys() and Device:hasDPad() then
self.key_events.ContentSelection = {
{ { "Up", "Down" } },
event = "ContentSelection",
}
self.key_events.GotoNextChapter = {
{ "Right" },
event = "GotoNextChapter",
args = 1,
}
self.key_events.GotoPrevChapter = {
{ "Left" },
event = "GotoPrevChapter",
args = -1,
}
elseif Device:hasDPad() then
self.key_events.MoveUp = {
{ "Up" },
event = "Panning",
@ -780,6 +806,10 @@ function ReaderRolling:onGotoPrevChapter()
return true
end
function ReaderRolling:onContentSelection()
return self.ui.highlight:onStartHighlightIndicator()
end
function ReaderRolling:onNotCharging()
self:updateBatteryState()
end

@ -62,6 +62,8 @@ function ReaderToc:onGesture() end
function ReaderToc:registerKeyEvents()
if Device:hasKeyboard() then
self.key_events.ShowToc = { { "T" } }
elseif Device:hasPageUpDownKeys() and Device:hasDPad() then
self.key_events.ShowToc = { { "ScreenKB" } }
end
end

@ -41,6 +41,7 @@ local Device = {
hasAuxBattery = no,
hasKeyboard = no,
hasKeys = no,
hasPageUpDownKeys = no,
canKeyRepeat = no,
hasDPad = no,
hasExitOptions = yes,

@ -458,6 +458,7 @@ local Kindle2 = Kindle:extend{
isREAGL = no,
hasKeyboard = yes,
hasKeys = yes,
hasPageUpDownKeys = yes,
hasDPad = yes,
canHWInvert = no,
canModifyFBInfo = no,
@ -471,6 +472,7 @@ local KindleDXG = Kindle:extend{
isREAGL = no,
hasKeyboard = yes,
hasKeys = yes,
hasPageUpDownKeys = yes,
hasDPad = yes,
canHWInvert = no,
canModifyFBInfo = no,
@ -484,6 +486,7 @@ local Kindle3 = Kindle:extend{
isREAGL = no,
hasKeyboard = yes,
hasKeys = yes,
hasPageUpDownKeys = yes,
hasDPad = yes,
canHWInvert = no,
canModifyFBInfo = no,
@ -495,6 +498,7 @@ local Kindle4 = Kindle:extend{
model = "Kindle4",
isREAGL = no,
hasKeys = yes,
hasPageUpDownKeys = yes,
hasDPad = yes,
canHWInvert = no,
canModifyFBInfo = no,
@ -543,6 +547,7 @@ local KindleVoyage = Kindle:extend{
canTurnFrontlightOff = no,
hasLightSensor = yes,
hasKeys = yes,
hasPageUpDownKeys = yes,
display_dpi = 300,
touch_dev = "/dev/input/event1",
}
@ -561,6 +566,7 @@ local KindleOasis = Kindle:extend{
isTouchDevice = yes,
hasFrontlight = yes,
hasKeys = yes,
hasPageUpDownKeys = yes,
hasGSensor = yes,
display_dpi = 300,
--[[
@ -579,6 +585,7 @@ 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",
@ -593,6 +600,7 @@ 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