Skip to content
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

Add screen lock functionality, unlocked by pressing both forward and back buttons simultaneously #341

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

narodnik
Copy link

@narodnik narodnik commented Dec 2, 2023

Motivation

I have a waterproof Kobo Libra H2O. In the rain or shower, water generates touch events on the screen. I want a way to disable these temporarily and only use the buttons.

The functionality is accessible inside the reader, select the top bar and select "Lock Screen Input". Then the screen is disabled, but you can still navigate using the buttons. Pressing them together unlocks the screen.

Core Organization

Most of the code is implemented in the top level plato and emulator apps. The code is duplicated, so I'd appreciate advise on where to put them. I added a LockScreenInput event, which sets a boolean, and then sends Event::Toggle(ViewId::TopBottomBars).

When the boolean is_screen_locked is set, then all Gesture events are caught and skipped. Lmk if this is the correct way to do this.

Apart from that, there's a bit of logic to handle pressing both buttons together.

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.

2 participants