mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
Introduce Device:useDPadAsActionKeys() (#11900)
1. Non-Kindle-specific `hasFiveWay` behavior is changed to `hasDPad and useDPadAsActionKeys`. For now they remain Kindle-specific in practice, unless one sets `useDPadAsActionKeys = yes` in a user patch. 2. With that disambiguation out of the way, `hasFiveWay` itself is further disambiguated into `hasScreenKB` and `hasSymKey`, as per the actual property being used, rather than something that tends to correlate with it. (It needn't be Kindle-specific per se, but non-Kindle devices have equivalent shortcuts with for example `Shift`.) Running the emulator with `DISABLE_TOUCH=1` will set `hasSymKey = yes`, which can be tested with right shift. Closes #11887.
This commit is contained in:
@@ -116,7 +116,7 @@ end
|
||||
function ReaderRolling:onGesture() end
|
||||
|
||||
function ReaderRolling:registerKeyEvents()
|
||||
if Device:hasFiveWay() then
|
||||
if Device:hasScreenKB() or Device:hasSymKey() then
|
||||
self.key_events.GotoNextView = {
|
||||
{ { "RPgFwd", "LPgFwd" } },
|
||||
event = "GotoViewRel",
|
||||
@@ -151,7 +151,7 @@ function ReaderRolling:registerKeyEvents()
|
||||
args = -1,
|
||||
}
|
||||
end
|
||||
if Device:hasFiveWay() then
|
||||
if Device:hasDPad() and Device:useDPadAsActionKeys() then
|
||||
self.key_events.GotoNextChapter = {
|
||||
{ "Right" },
|
||||
event = "GotoNextChapter",
|
||||
@@ -174,7 +174,7 @@ function ReaderRolling:registerKeyEvents()
|
||||
args = {0, 1},
|
||||
}
|
||||
end
|
||||
if Device:hasFiveWay() and not Device:hasKeyboard() then
|
||||
if Device:hasScreenKB() then
|
||||
self.key_events.MoveUp = {
|
||||
{ "ScreenKB", "RPgBack" },
|
||||
event = "Panning",
|
||||
|
||||
Reference in New Issue
Block a user