Files
Kaj SchittecatandClaude Opus 5.5 2fc2288879 web: phones and tablets get a UI that fills the screen
- the canvas is sized from the space below the bar at about one CSS pixel per
  canvas pixel, whole device pixels where possible (crisp): iPhone 14 390x616,
  Pixel 7 360x692, iPad 540x686; landscape by height and the window's aspect
  (664x358, 734x330, 720x506). A computer keeps the framed 800x480. Same
  large-screen layouts, which size themselves from the display.
- a turn restarts the UI in the other layout only when the aspect flips and
  the width changes (a keyboard is no turn), never while typing
- the phone keyboard: no focus ring or tab hotkey letters for it
  (CAP_NATIVE_KEYBOARD in the nav-keys block), keeps up while tapping the UI
  mid-edit; IME composition followed live
- the page: slim one-row bar (slimmer on its side), safe areas, link help as
  an overlay, home-screen icons (icons/app-icon.svg + render.mjs, maskable)
- tests: web/build.sh mobiletest (iPhone 14, Pixel 7, iPad): fill > 90 %,
  UTF-8 + emoji through the hidden field, IME composition, send, turn and
  back with the message kept, chooser, manifest. Labels found by text
  (wadamesh.findText) so taps work at any size; the UTF-8 storage check
  searches bytes. webtest's phone step checks the portrait canvas.
- WEB_BUILD.md "Phones and tablets"; the stray docs/tmp shots removed

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-18 16:12:46 +02:00

26 lines
1.5 KiB
C++

#pragma once
// Pointer + keyboard state shared by the SDL event pump (host_main.cpp) and the
// board input drivers the UI calls (WebTouch.cpp: the heltecV4CapTouch* touch API,
// WebKeyboard.cpp: the CardKB external-keyboard API). All on the UI thread.
#include <stdint.h>
void webPointer(bool down, int x, int y); // in canvas pixels
// CardKB codes (ASCII, 0x08 BS, 0x0D Enter, 0x1B Esc, 0xB4-0xB7 arrows), or text as
// WADA_KEY_TEXT | code point (any script, emoji: UITask's cardKbUiKey passes it through).
constexpr int WADA_KEY_TEXT = 0x40000000; // = BleKeyboard.h BLE_KEY_TEXT
void webKeyPush(int code);
void webTextPush(const char* utf8); // each code point as typed text
// The phone's own keyboard types (web/shell/app.js): the UI keeps its on-screen keys
// down, as for any external keyboard.
void webKeyboardPresent(bool on);
// Mouse wheel / trackpad scroll at (x, y) in canvas pixels, dy > 0 = towards the end
// of a list (WebLvglInput.cpp). webWheelTick: once per board step.
void webWheel(int x, int y, int dy);
void webWheelTick();
// Text fields for the phone keyboard (WebLvglInput.cpp, LVGL side): a textarea under (x, y);
// whether the UI's keyboard is bound to a field.
bool webTextareaAt(int x, int y);
bool webEditing();
bool webOskShown(); // the UI's own on-screen keys are up (tests)
int webFindText(const char* text); // tests: the middle of a visible label, (x << 16) | y, or -1
const char* webEditText(); // tests: the text of the field being edited, or ""