Skip to content

Input improvements: swipe, long-press, and device touch tables (Phase 4) #7

@Ashex

Description

@Ashex

Context

Input improvements were planned as Phase 4 of the rewrite. A swipe experiment was attempted but removed after poor on-device behavior. Touch transforms currently rely on environment variables (SKEETS_REWRITE_TOUCH_MIRROR_X, SKEETS_REWRITE_TOUCH_PROTOCOL) set by the launcher rather than a built-in device table.

Sub-tasks

Swipe & long-press detection

  • Add TOUCH_SWIPE_UP, TOUCH_SWIPE_DOWN, TOUCH_SWIPE_LEFT, TOUCH_SWIPE_RIGHT to touch event types
  • Implement swipe detection: track DOWN→UP displacement + velocity, emit swipe if both exceed thresholds
  • Add TOUCH_LONG_PRESS event: emit when DOWN held >500ms without movement beyond tap threshold
  • Replace manual scroll tracking in feed view with swipe events
  • Investigate and resolve the earlier on-device swipe behavior issues before re-enabling

Device-aware touch transforms

  • Build a lookup table keyed on device model (from device_kobo_model_string()) for axis swap/mirror flags
  • Use FBInk's FBInkState.touch_swap_axes, touch_mirror_x, touch_mirror_y flags as the primary source
  • Fall back to the current axis-span heuristic + env var overrides for unknown devices
  • Remove dependency on launcher-set environment variables for known device models

References

  • KOReader per-device tables: frontend/device/kobo/device.lua — explicit touch_switch_xy, touch_mirrored_x, touch_mirrored_y per model
  • FBInk touch flags: FBInkState.touch_swap_axes, touch_mirror_x, touch_mirror_y
  • Current input layer: src/platform/input.h/cpp

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions