Skip to content

Comments

Add DPI28 (2.8") touchscreen display and touch input support#223

Open
3rdIteration wants to merge 4 commits intodevfrom
codex/implement-touchscreen-and-2.8-display-functionality
Open

Add DPI28 (2.8") touchscreen display and touch input support#223
3rdIteration wants to merge 4 commits intodevfrom
codex/implement-touchscreen-and-2.8-display-functionality

Conversation

@3rdIteration
Copy link
Owner

Motivation

  • Enable support for the Waveshare 2.8" DPI framebuffer touchscreen so the device can use the physical 480x640 DPI display with a 240x240 native UI and a bottom touch bar.
  • Provide direct touchscreen input (taps, touch-bar buttons, and navigation fallback) so screens can accept taps on UI elements and the touch bar.
  • Auto-detect hardware and expose a selectable dpi28_240x240 display configuration to simplify switching between desktop and touchscreen modes.

Description

  • Added a framebuffer display driver src/seedsigner/hardware/DPI28.py that scales 240x240 UI images to the 480x480 UI region, composes a 160px touch bar, and writes BGRA/RGB565 to /dev/fb0 (with numpy-accelerated and pure-Python fallbacks).
  • Added raw touch input reader src/seedsigner/hardware/touch.py and a touch adapter src/seedsigner/hardware/touchbuttons.py that expose a HardwareButtons-compatible interface plus tap detection, touch-bar events, and helpers like get_last_tap_native_coords() and register_buttons().
  • Integrated DPI28/touch into the app: src/seedsigner/hardware/displays/display_driver.py now supports dpi28, src/seedsigner/models/settings_definition.py adds dpi28_240x240 to available display options, and src/seedsigner/gui/renderer.py auto-detects framebuffer/touch hardware and sets SEEDSIGNER_DISPLAY/SEEDSIGNER_TOUCH.
  • Wired touch behavior into the UI: src/seedsigner/gui/screens/screen.py, seed_screens.py, and tools_screens.py now select the input handler (touch vs GPIO), register button hit boxes, handle direct taps, manage touch-bar label updates via Renderer.set_touch_bar_labels(), and hide/show the touch bar on screens where appropriate.
  • Keyboard and helper updates include src/seedsigner/gui/keyboard.py adding get_key_at_screen_coords() to support direct keyboard taps, and src/seedsigner/gui/toast.py uses the correct input handler for dismiss/cancel behavior.

Testing

  • No automated tests were executed as part of this change set; the patch adds the new drivers and touch integration but no CI/test runs were performed in this rollout.

Codex Task

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant