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:
Stupid retard noob attention king 2023-06-30 00:24:18 +08:00 committed by GitHub
parent 19b77bf03b
commit e15a8ed2d8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 47 additions and 28 deletions

View file

@ -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 */