koreader / koreader

An ebook reader application supporting PDF, DjVu, EPUB, FB2 and many more formats, running on Cervantes, Kindle, Kobo, PocketBook and Android devices
http://koreader.rocks/
GNU Affero General Public License v3.0
16.74k stars 1.27k forks source link

[FR] Cervantes: double click on home button #5974

Open Brnoch opened 4 years ago

Brnoch commented 4 years ago

Device: bq Cervantes As the button located on the edge of the Cervantes is not easy to use (especially at night), it's somewhat difficult to put the reader in standby mode, and then to wake him up. Would it be possible to implement one functionality of the bq firmware : when the user double clicks on the home button, the reader goes to standby mode, and when he performs the same action while the reader is in standby mode, the reader wakes up?

Frenzie commented 4 years ago

Btw, there are many ways to enter standby besides using the button. It can be assigned to a gesture of your choice via Settings → Taps & gestures → Gesture manager, as well as via Hamburger/File → Exit → Sleep.

avsej commented 4 years ago

But can you wake it up with gesture? The edge button is pretty weak, so I'd also vote for double-click feature to suspend/wakeup

Frenzie commented 4 years ago

So you're saying the device doesn't wake up when you double tap that button?

Brnoch commented 4 years ago

Yes, nothing happens in this case

pazos commented 4 years ago

@avsej: feel free to implement it if you wish. I'm not interested myself. IMHO is not worth the hassle.

Generating multiple key events based on different press/release patterns is not difficult. You can rename the "Home" action to something like "MultiActionButton" and add a new handler on input.lua. This way you can delay actions a few milliseconds (to wait for a given pattern) without messing with delays for other actions.

So you're saying the device doesn't wake up when you double tap that button?

Nope, but I never tried to program it otherwise, so I dunno if this is actually feasible. https://github.com/bq/cervantes/blob/master/QBookApp/src/PowerManager.cpp could be useful to understand the way BQ app handles power states :+1:

Edit: actually https://github.com/bq/cervantes/blob/master/QBookApp/src/QBookApp.cpp#L2429-L2486 shows the behaviour.

Brnoch commented 4 years ago

@pazos Too bad you're not interested. Maybe it's because I use my cervantes 4 for a short time now, but I always struggle to find the edge button with my finger.