Skip to content

Add adaptive numeric keyboard for color LCD#7338

Open
onliner10 wants to merge 2 commits into
EdgeTX:mainfrom
onliner10:codex/adaptive-numeric-keyboard
Open

Add adaptive numeric keyboard for color LCD#7338
onliner10 wants to merge 2 commits into
EdgeTX:mainfrom
onliner10:codex/adaptive-numeric-keyboard

Conversation

@onliner10
Copy link
Copy Markdown

Summary

This updates the color LCD NumberEdit touch keyboard from the step-control pad to a direct, adaptive numeric keypad.

The keypad is optimized for touch entry:

  • always shows digits, backspace, cursor movement, and OK
  • shows +/- only when the edited field can be negative
  • shows . only for PREC1 / PREC2 fields
  • keeps existing rotary and hardware-key editing semantics intact
  • commits typed text through NumberEdit::setValue(), so existing min/max clamping remains authoritative

Fixes #3722.

Screenshots

Positive integer Decimal field
Positive integer date keypad Decimal battery low keypad
Signed field Clamped out-of-range input
Signed trainer weight keypad Date field clamped after out-of-range input

Implementation Notes

  • Adds raw numeric formatting/parsing helpers to NumberEdit, separate from display strings with prefixes/suffixes/custom handlers.
  • Uses a full-screen NumberKeyboard layout for larger finger targets on color LCD radios.
  • Adds a small title/value header so the full-screen editor shows what field is being edited without styling the title like the value.
  • Keeps custom-display fields on the existing adjustment pad unless they explicitly opt into direct numeric entry.
  • Avoids RTTI in firmware builds by using a virtual form-field title hook instead of dynamic_cast.
  • Saturates very large typed values before clamping to avoid signed integer overflow.

Testing

  • Built the TX16S simulator with the UI harness.
  • Exercised the keypad through the UI harness for integer, signed, decimal, fallback/custom-display, and out-of-range clamping scenarios.
  • Tested on a TX16S MK2.
  • Verified the fork TX16S firmware release workflow builds successfully with strict compiler checks.

@onliner10 onliner10 marked this pull request as ready for review May 3, 2026 16:28
@philmoz
Copy link
Copy Markdown
Collaborator

philmoz commented May 5, 2026

Lvgl has a native numeric keyboard which would be preferable to maintain consistency with the text keyboard.

You can see the numeric keyboard by pressing the SYS key while editing a text field.

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.

Digits (only) keyboard for numeric inputs

2 participants