Individually invert left or right side page turn buttons on Kindle (#11963)
K4 is ergonomically designed to be held with one hand (one's hand wrapped around the back and both thumb and middle finger on either PgFwd buttons). This PR allows users to individually invert left and right page turners such that it can be operated just with one hand. It also closes #9350 Not sure if there are any other devices with two sets of page turn buttons, so currently limited to kindle, excluding kindle Voyage, but could be added too, albeit with some gymnastics.
This commit is contained in:
1 parent
2d07a82ea2
commit
7a84cfef4a
2 files changed
+57
No files matched your search
@@ -170,6 +170,30 @@ function Device:invertButtons()
|
||||
end
|
||||
end
|
||||
|
||||
function Device:invertButtonsLeft()
|
||||
if self:hasKeys() and self.input and self.input.event_map then
|
||||
for key, value in pairs(self.input.event_map) do
|
||||
if value == "LPgFwd" then
|
||||
self.input.event_map[key] = "LPgBack"
|
||||
elseif value == "LPgBack" then
|
||||
self.input.event_map[key] = "LPgFwd"
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function Device:invertButtonsRight()
|
||||
if self:hasKeys() and self.input and self.input.event_map then
|
||||
for key, value in pairs(self.input.event_map) do
|
||||
if value == "RPgFwd" then
|
||||
self.input.event_map[key] = "RPgBack"
|
||||
elseif value == "RPgBack" then
|
||||
self.input.event_map[key] = "RPgFwd"
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function Device:init()
|
||||
if not self.screen then
|
||||
error("screen/framebuffer must be implemented")
|
||||
|
||||
Reference in new issue
Block a user