-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Kindle: toggle cover events #10363
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
Kindle: toggle cover events #10363
Conversation
I don't quite recall how this works on Kindle, but, FWIW, on Kobo, we essentially get an EV_KEY with a specific keycode, so we can easily ignore the event (and go back to sleep if necessary). It's handled over here for the UI side: koreader/frontend/ui/elements/common_settings_menu_table.lua Lines 213 to 237 in 6c2f230
And sorted somewhere in Device:
TL;DR: Feel free to move the menu entry somewhere around there, too? |
Oh, ok, it's just sleep cover handling ! :) |
We already have code at least in Kobo to deal with spurious wakeups, basically a reasonably quick go back to sleep if no input for a minute (or whatever). As for the menu item I think it should probably just reuse the Kobo "sleepcover event" message; the technical side you'd have to check what the best way is to abstract it away. |
As usual on kindle we cant get the events, we can only change the sysfs knob to enable / disable on a driver level |
Kindle also does not advertise as a sleep cover so kindle users might not be familiar with the term. Maybe cover events? Also i need help with |
I think that maps fairly cleanly to "ignore all sleepcover events"? :-) |
What term does Kindle use? |
Kindle {model} cover Deep in product details it says wakes and sleeps kindle |
Random fun fact: I seem to recall that (on the PW5, at least) there's actually (at least?) two of them, one calibrated for the back, and one for the front. This is (I imagine) to help deal with tolerance issues to prevent false-positives from the back (when there's an actual cover involved, at least). I don't recall how/where/why I even checked that, because I've never used a cover with a Kindle, but I remember thinking that it the implementation looked neat (especially given the amount of crap false positives like that have caused on kobo ;p). |
if Device:isKindle() and PowerD:hasHallSensor() then | ||
common_settings.cover_events = { | ||
text = _("Cover events"), | ||
help_text = _([[Enable or disable the hall effect sensor. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"The Hall-effect principle is named for physicist Edwin Hall. In 1879 he discovered that when a conductor or semiconductor with current flowing in one direction was introduced perpendicular to a magnetic field a voltage could be measured at right angles to the current path."
May be capitilize "hall"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Incidentally, I've been considering buying a Gulikit KingKong 2, with Hall effect sensors.
But over here as I said I'm not sure how much sense it makes to talk about the underlying tech instead of what it does (i.e., detect covers).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, I understand that the Kindle has it enabled by default ? And that you added that option to allow disabling it because it sucks ?
Then I would just name it [ ] Disable cover events
(or [ ] Disable Kindle cover events
if it's really clear to all it's Kindle system stuff outside of us).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I meant the capitalization only.
Makes sense, as it is more difficult to trigger this on my pw5 then on older models |
Allow disabling the hall efect sensor via the sysfs knob, so the kindle system wont sleep & wake the device for those of use that stay in koreader, are caseless and have get spurious wakeups
Ready to merge |
Fine with the final wording. (Haven't looked at the lower level stuff.) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, left a small phrasing nit
Co-authored-by: Frans de Jonge <fransdejonge@gmail.com>
used on kindle but can be extended to other devicesAllow disabling the hall efect sensor via the sysfs knob, so the kindle system wont sleep & wake the device
for those of use that stay in koreader, are caseless and get spurious wakeups
This change is