Skip to content

Individually Invert page turners on kindle#11963

Merged
Frenzie merged 8 commits into
koreader:masterfrom
Commodore64user:invert-page-turners
Jun 5, 2024
Merged

Individually Invert page turners on kindle#11963
Frenzie merged 8 commits into
koreader:masterfrom
Commodore64user:invert-page-turners

Conversation

@Commodore64user

@Commodore64user Commodore64user commented Jun 2, 2024

Copy link
Copy Markdown
Member

As seen on this picture, 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).

90 copy

  • 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 [Legacy Kindle/K3GB] Buttons mapped incorrectly when in landscape mode #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 change is Reviewable

Comment thread frontend/ui/elements/physical_buttons.lua Outdated
@Commodore64user

Commodore64user commented Jun 4, 2024

Copy link
Copy Markdown
Member Author

I don't know if this is something that could/should be included here, but it would be nice to have a user patch that displays a dog ear in the bottom left/right corner of the screen, that indicates that one set of page turn buttons is currently inverted.

@Commodore64user

Copy link
Copy Markdown
Member Author

So I am running this locally on K4 and found a bug. So if i invert one set (right one for example) then whole thing works as expected, no problems. However, if I restart KOReader, when the programme is back up and running again, even though the option is selected ([✓] invert right-side page turn buttons) the inversion does not actually occur, meaning both sets of page turn button continue to operate in a regular fashion (i.e RightPgFwd goes to next page). This does not happen if you select the existing option to invert all page turn buttons, i.e buttons continue to be inverted upon restart. Any ideas why this might be happening?

Comment thread frontend/device/devicelistener.lua Outdated
Device:invertButtons()
end

function DeviceListener:onSwapLeftPageTurnButtons()

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hius07 any thoughts on adding an event?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think these new actions are worth to be added to Dispatcher, hence no need of proxy methods in DeviceListener.
All can be done in the menu elements module, with direct calls of Device:.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree.

@Commodore64user Commodore64user Jun 4, 2024

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this what you mean?

table.insert(PhysicalButtons.sub_item_table, {
    text = _("Invert left side page-turn buttons"),
    checked_func = function()
        return G_reader_settings:isTrue("input_invert_left_page_turn_keys")
    end,
    callback = function()
        -- UIManager:broadcastEvent(Event:new("SwapLeftPageTurnButtons"))
        G_reader_settings:flipNilOrFalse("input_invert_left_page_turn_keys")
        Device:invertButtonsLeft()
    end,
})

@Frenzie Frenzie merged commit 7a84cfe into koreader:master Jun 5, 2024
@Frenzie Frenzie added this to the 2024.06 milestone Jun 5, 2024
@Commodore64user Commodore64user deleted the invert-page-turners branch June 5, 2024 08:31
@Commodore64user

Copy link
Copy Markdown
Member Author

Wondering if you guys noticed #11963 (comment)

@poire-z

poire-z commented Jun 5, 2024

Copy link
Copy Markdown
Contributor

However, if I restart KOReader, when the programme is back up and running again, even though the option is selected ([✓] invert right-side page turn buttons) the inversion does not actually occur, meaning both sets of page turn button continue to operate in a regular fashion

I guess that on koreader startup, nowhere you call Device:invertButtonsRight() so nothing happens.
You'd need to, somewhere, the same place other such key behavour settings are checked and activated, you should if settings:isTrue("blahright") then Device:invertButtonsRight() end

@Commodore64user

Copy link
Copy Markdown
Member Author

I can't even find one for Device:invertButtons() which is the one that works, so not sure where that startup procedure checks what is on and makes the appropriate changes. I also didn't have to worry about this with the readerhighlight and that one works okay.

@poire-z

poire-z commented Jun 5, 2024

Copy link
Copy Markdown
Contributor

function Device:init()

-- Handle button mappings shenanigans
if self:hasKeys() then
if G_reader_settings:isTrue("input_invert_page_turn_keys") then
self:invertButtons()
end
end

@Commodore64user

Copy link
Copy Markdown
Member Author

function Device:init()

-- Handle button mappings shenanigans
if self:hasKeys() then
if G_reader_settings:isTrue("input_invert_page_turn_keys") then
self:invertButtons()
end
end

oops, I swear I did not see that.

Frenzie pushed a commit that referenced this pull request Jun 5, 2024
0xstillb pushed a commit to 0xstillb/koreader-thai that referenced this pull request May 9, 2026
…oreader#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 koreader#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.
0xstillb pushed a commit to 0xstillb/koreader-thai that referenced this pull request May 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Legacy Kindle/K3GB] Buttons mapped incorrectly when in landscape mode

4 participants