mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-08-07 14:12:31 -04:00
improve keyboard (#1209)
* init commit for raw input in keyboard * clean up * clean up - 1 * clean up - 2 * can input underline and < now * format fix * textual change * textual change - 2 * textual change - 3 * textual change - 4 * edit for PR comment * edit for PR comment - 2 * edit for PR comment - 3 * edit for PR comment - 4 * edit for PR comment - 5
This commit is contained in:
parent
19b77bf03b
commit
e15a8ed2d8
6 changed files with 47 additions and 28 deletions
|
@ -43,14 +43,14 @@ class AlphanumView : public TextEntryView {
|
|||
bool on_encoder(const EncoderEvent delta) override;
|
||||
|
||||
private:
|
||||
const char* const keys_upper = "ABCDEFGHIJKLMNOPQRSTUVWXYZ, .<";
|
||||
const char* const keys_lower = "abcdefghijklmnopqrstuvwxyz, .<";
|
||||
const char* const keys_digit = "0123456789!\"#'()*+-/:;=>?@[\\]<";
|
||||
const char* const keys_upper = "ABCDEFGHIJKLMNOPQRSTUVWXYZ, ._";
|
||||
const char* const keys_lower = "abcdefghijklmnopqrstuvwxyz, ._";
|
||||
const char* const keys_digit = "0123456789!\"#'()*+-/:;=<>@[\\]?";
|
||||
|
||||
const std::pair<std::string, const char*> key_sets[3] = {
|
||||
{"Upper", keys_upper},
|
||||
{"Lower", keys_lower},
|
||||
{"Digit", keys_digit}};
|
||||
{"ABC", keys_upper},
|
||||
{"abc", keys_lower},
|
||||
{"123", keys_digit}};
|
||||
|
||||
int16_t focused_button = 0;
|
||||
uint32_t mode = 0; // Uppercase
|
||||
|
@ -60,13 +60,10 @@ class AlphanumView : public TextEntryView {
|
|||
|
||||
std::array<Button, 30> buttons{};
|
||||
|
||||
Button button_mode{
|
||||
{21 * 8, 33 * 8, 8 * 8, 32},
|
||||
""};
|
||||
Labels labels{
|
||||
{{1 * 8, 33 * 8}, "Raw:", Color::light_grey()},
|
||||
{{1 * 8, 35 * 8}, "AKA:", Color::light_grey()}};
|
||||
|
||||
Text text_raw{
|
||||
{1 * 8, 33 * 8, 4 * 8, 16},
|
||||
"Raw:"};
|
||||
NumberField field_raw{
|
||||
{5 * 8, 33 * 8},
|
||||
3,
|
||||
|
@ -74,9 +71,17 @@ class AlphanumView : public TextEntryView {
|
|||
1,
|
||||
'0'};
|
||||
|
||||
Button button_ok{
|
||||
{10 * 8, 33 * 8, 9 * 8, 32},
|
||||
"OK"};
|
||||
Text text_raw_to_char{
|
||||
{5 * 8, 35 * 8, 4 * 8, 16},
|
||||
"0"};
|
||||
|
||||
Button button_delete{
|
||||
{10 * 8 - 2, 33 * 8, 4 * 8 + 2, 32},
|
||||
"<DEL"};
|
||||
|
||||
Button button_mode{
|
||||
{16 * 8 - 2, 33 * 8, 4 * 8 + 2, 32},
|
||||
""};
|
||||
};
|
||||
|
||||
} /* namespace ui */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue