New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Assorted minor tweaks #4475

Merged
merged 4 commits into from Jan 20, 2019

Conversation

Projects
None yet
3 participants
@NiLuJe
Copy link
Member

NiLuJe commented Jan 12, 2019

  • WiFi handling on Kindle (fix #4472)
  • Crappy attempt at handling key repeat for the Forma pageturn buttons
  • Fix long-standing OTA inconsistencies on Kindle so that OTAManager picks the right binaries (Massive oversight on my part there -_-") (re #4497).
    • Use the proper binaries (kindle5 -> kindle) on the K4
    • Use the proper binaries (kindlepw2) on every Kindle since the PW2.
@NiLuJe

This comment has been minimized.

Copy link
Member Author

NiLuJe commented Jan 12, 2019

As mentioned in the code, key repeat is, err, fairly crappy :D.

Ideally, we'd queue every repeat events, and simply flush the queue on release.

Unfortunately, I have no idea how to do that (and if we even can with the current Event framework) ;).

@NiLuJe

This comment has been minimized.

Copy link
Member Author

NiLuJe commented Jan 12, 2019

(Will squash manually for a rebase merge, as the two things have nothing in common).

@NiLuJe NiLuJe force-pushed the NiLuJe:master branch from 69dd87d to e2ef12a Jan 12, 2019

@pazos

This comment has been minimized.

Copy link
Contributor

pazos commented Jan 12, 2019

@NiLuJe: not sure if I understand handling key repeat for the Forma pageturn buttons. Do you want to avoid them or to react to them as key press/release?

@pazos

This comment has been minimized.

Copy link
Contributor

pazos commented Jan 13, 2019

function Input:keyRepeatAsPress(ev)
    if ev.type == EV_KEY and ev.value == EVENT_VALUE_KEY_REPEAT then
        if ev.code == "LPgBack" -- replace strings with constants (int)
          or ev.code == "RPgBack"
          or ev.code == "LPgFwd"
          or ev.code == "RPgFwd" then
            ev.value = 1
        end
    end
end
@NiLuJe

This comment has been minimized.

Copy link
Member Author

NiLuJe commented Jan 13, 2019

@pazos: This reacts to them, and treats them as KeyPress, as long as that's coming from a pageturn button. All other repeats are ignored.

I created the KeyRepeat event mainly because it might come in handy later, but right now, this behaves exactly as if the event sent was a KeyPress one, since the onKeyRepeat handler is just a copy of onKeyPress.

@pazos

This comment has been minimized.

Copy link
Contributor

pazos commented Jan 13, 2019

This reacts to them, and treats them as KeyPress, as long as that's coming from a pageturn button. All other repeats are ignored.

ok, updated the example. It can be installed as an event hook for kobos.

Imo it is better to have specific hooks because it is easier to understand them and they can be repurposed for other devices in the future.

@Frenzie
Copy link
Member

Frenzie left a comment

lgtm even if parts are a bit inelegant ;-)

@NiLuJe

This comment has been minimized.

Copy link
Member Author

NiLuJe commented Jan 13, 2019

@pazos:

I'd tend to agree with you in theory, except here:

  • It's generic enough to make sense in the common code. Only the crappy staggering bit is potentially device-specific, and I'm already not happy with it ;).
  • I'd really like to keep a separate KeyRelease event, because ideally I would actually like to handle it differently than a Press: namely, making repeat pageturn force A2 refresh mode, while a release after a string of repeat would be a forced flashing GC16.

NiLuJe added some commits Jan 11, 2019

Better-than-nothing key repeat handling.
Mainly aimed at the Forma.
Still fairly terrible, as these things goes ;p.
Fix WiFi status on Kindle
WiFi handling is handled asynchronously (deferred to lipc), so this is a
bit clunkier than on devices where we handle WiFi ourselves...

But, basically, try to honor the menu callback when toggling WiFi so
that the status gets updated in the menu.

Fix #4472
Point the Kindle 4 to non-legacy OTAs
It uses the same CPU as a Kindle Touch ;).

@NiLuJe NiLuJe force-pushed the NiLuJe:master branch from 7cb01d2 to 30e8d46 Jan 20, 2019

@NiLuJe NiLuJe merged commit e1cb983 into koreader:master Jan 20, 2019

1 check passed

ci/circleci Your tests passed on CircleCI!
Details

Frenzie added a commit that referenced this pull request Feb 1, 2019

[fix, Kindle] Fix i.MX 6/7 detection pattern (#4539)
Some variants have a space before the number, others don't :/.

Followup to #4475
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment