CDC Badge OS
Firmware for the CDC Badge v1.0 hardware security key
Loading...
Searching...
No Matches
T9InputView.cpp File Reference
#include "cdc_views/T9InputView.h"
#include "cdc_views/KeyCodes.h"
#include "cdc_views/RenderHelpers.h"
#include "cdc_views/ToastView.h"
#include "cdc_ui/ViewStack.h"
#include "cdc_ui/I18n.h"
#include "cdc_hal/IDisplay.h"
#include "cdc_log.h"
#include "esp_timer.h"
#include <goodisplay/gdey029T94.h>
#include <cstring>

Go to the source code of this file.

Namespaces

namespace  cdc
namespace  cdc::ui
 Centralized key-code constants for cdc_views.

Functions

T9InputViewcdc::ui::showT9Input (const char *title, const char *initialText, T9InputView::SaveCallback onSave, uint16_t maxLen)
 Shows a shared T9 input view instance.

Variables

static const char * TAG = "T9InputView"
static const char * t9_chars []
 T9 digit-to-character mapping table.
static constexpr int TITLE_Y = 5
 Display layout constants.
static constexpr int TEXT_Y = 50
static constexpr int TEXT_MARGIN = 10
static T9InputView cdc::ui::s_sharedT9Input
 Convenience factory/helper function.

Variable Documentation

◆ t9_chars

const char* t9_chars[]
static
Initial value:
= {
" 0",
".@?!,;:'\"()-_#$%&*+=/\\<>[]{}|^~`1"
"\x9B\x9C\x9D\xA8\xAD\xAE\xAF\xAB\xAC\xF1\xF8\xFD\xE6\xF6",
"abcABC2\x84\xA0\x83\x85\x86\x91\x8E\x8F\x92\x87\x80",
"defDEF3\x82\x8A\x88\x89\x90",
"ghiGHI4\xA1\x8D\x8C\x8B",
"jklJKL5",
"mnoMNO6\xA2\x95\x93\x94\x99\xA4\xA5",
"pqrsPQRS7\xE1",
"tuvTUV8\x81\x9A\xA3\x97\x96",
"wxyzWXYZ9\x98"
}

T9 digit-to-character mapping table.

Order per key: lowercase letters, uppercase letters, digit, then accented variants (CP437 single-byte codes). Adafruit-GFX must be configured with cp437(true) for the accented glyphs to render correctly.

Definition at line 28 of file T9InputView.cpp.

Referenced by cdc::ui::T9InputView::getChar(), and cdc::ui::T9InputView::getCharCount().

◆ TAG

const char* TAG = "T9InputView"
static

T9InputView Implementation

Multi-tap text input like classic phones.

Definition at line 19 of file T9InputView.cpp.

◆ TEXT_MARGIN

int TEXT_MARGIN = 10
staticconstexpr

Definition at line 47 of file T9InputView.cpp.

◆ TEXT_Y

int TEXT_Y = 50
staticconstexpr

Definition at line 46 of file T9InputView.cpp.

◆ TITLE_Y

int TITLE_Y = 5
staticconstexpr

Display layout constants.

Definition at line 45 of file T9InputView.cpp.