mirror of
https://github.com/portapack-mayhem/mayhem-firmware.git
synced 2025-08-14 02:17:39 +00:00
BLE Tx App / BLE Rx Filtering. (#1543)
BLE TX app creation BLE RX and TX app improvements
This commit is contained in:
@@ -118,7 +118,12 @@ void AlphanumView::refresh_keys() {
|
||||
|
||||
size_t n = 0;
|
||||
for (auto& button : buttons) {
|
||||
button.set_text(std::string{key_list[n]});
|
||||
if (n > strlen(key_list)) {
|
||||
button.set_text(std::string{'\0'});
|
||||
} else {
|
||||
button.set_text(std::string{key_list[n]});
|
||||
}
|
||||
|
||||
n++;
|
||||
}
|
||||
|
||||
@@ -137,7 +142,9 @@ void AlphanumView::refresh_keys() {
|
||||
|
||||
void AlphanumView::on_button(Button& button) {
|
||||
const auto c = button.text()[0];
|
||||
char_add(c);
|
||||
if (c != '\0') {
|
||||
char_add(c);
|
||||
}
|
||||
|
||||
// TODO: Consolidate shift handling.
|
||||
if (shift_mode == ShiftMode::Shift) {
|
||||
|
@@ -57,6 +57,7 @@ class AlphanumView : public TextEntryView {
|
||||
const char* const keys_upper = "ABCDEFGHIJKLMNOPQRSTUVWXYZ, .";
|
||||
const char* const keys_digit = "1234567890()'`\"+-*/=<>_\\!?, .";
|
||||
const char* const keys_symbl = "!@#$%^&*()[]'`\"{}|:;<>-_~?, .";
|
||||
const char* const keys_hex = "1234567890ABCDEF ";
|
||||
|
||||
struct key_set_t {
|
||||
const char* name;
|
||||
@@ -64,9 +65,10 @@ class AlphanumView : public TextEntryView {
|
||||
const char* shifted;
|
||||
};
|
||||
|
||||
const key_set_t key_sets[2] = {
|
||||
const key_set_t key_sets[3] = {
|
||||
{"abc", keys_lower, keys_upper},
|
||||
{"123", keys_digit, keys_symbl}};
|
||||
{"123", keys_digit, keys_symbl},
|
||||
{"hex", keys_hex, keys_hex}};
|
||||
|
||||
int16_t focused_button = 0;
|
||||
uint32_t mode = 0; // Letters.
|
||||
|
Reference in New Issue
Block a user