Skip to content

feat: quick button lock for pocketing without sleep #329

Description

@gershalfred

I prototyped a narrow Quick Lock feature for the top/power button and wanted to surface it for maintainer review before assuming it belongs in CrossInk.

Use case

Sometimes you want to quickly stash the reader in a pocket/bag while keeping the current page visible and the device awake. Sleeping is safe, but it is heavier than needed when you only need to pause for a few seconds/minutes and avoid accidental page turns or menu actions.

Proposed behavior

Add a configurable Quick Lock action to the existing power-button action settings:

  • available for Short-press Action or Long-press Action
  • pressing the configured top-button gesture toggles Quick Lock on/off
  • while locked, the device stays awake and the current screen remains visible
  • normal activity input is swallowed, so page/menu/navigation buttons do not fire
  • unlocking uses the same configured top-button gesture

Prototype implementation

I have a small patch here:

https://gist.github.com/gershalfred/472a37e5e05355e5273bfce31e7d9c08

Branch:
https://github.com/gershalfred/crossink-reader/tree/feature/quick-button-lock

The implementation is intentionally scoped down:

  • no persistent lock state
  • no sleep-screen/security model
  • no button-combo remapping
  • no reader-specific logic
  • no heap allocation
  • just a runtime input gate plus one new power-button action option

Prior art / scope note

CrossPoint had related button-lock PRs before, but they were closed as out of scope / tied to broader lock-screen discussion. This proposal is narrower: a temporary pocket lock for active reading, not a full transport/security lock.

Validation

  • git diff --check passed
  • pio run -e simulator was attempted but currently fails on current main before this feature is meaningfully tested because the simulator WiFi.disconnect(bool, bool) stub does not match the call WiFi.disconnect(false, false, 1000) in src/activities/network/WifiSelectionActivity.cpp
  • pio run -e default was attempted but is blocked in this checkout by the existing PlatformIO SDK layout issue: open-x4-sdk/libs/hardware/BatteryMonitor is missing / not a directory

Hardware verification request

If this seems in-scope, the hardware test is:

  1. Set Long-press Action to Quick Lock.
  2. Open a book or any normal screen.
  3. Long-press the top button.
  4. Confirm a brief “Buttons locked” popup appears and the previous screen returns.
  5. Press page/menu/navigation buttons and confirm nothing changes.
  6. Long-press the top button again.
  7. Confirm “Buttons unlocked” appears and normal controls resume.
  8. Confirm the device does not auto-sleep while quick-locked.

Happy to restage this differently if a PR from my fork path becomes available or if you prefer a different unlock gesture.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions