mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 00:37:25 +01:00
Add a delete button to the keyboard.
Change-Id: I10e57f19a7edfb4a59fb3c2f48bc0f8a8a58643f
This commit is contained in:
@@ -153,6 +153,15 @@ char* get_text() {
|
||||
}
|
||||
// we want to be inside the parenthese if there are some.
|
||||
index -= (tmp > 2) ? 2 : 0;
|
||||
} else if (event == DELETE) {
|
||||
// Nothing to delete.
|
||||
if (index == max) {
|
||||
continue;
|
||||
}
|
||||
for (int i=index; i<max+1; i++) {
|
||||
input[i] = input[i+1];
|
||||
}
|
||||
max--;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -78,6 +78,7 @@ typedef enum {
|
||||
UP_ARROW,
|
||||
DOWN_ARROW,
|
||||
TRIG_MENU,
|
||||
DELETE,
|
||||
ERROR = 0xffffffff,
|
||||
} ion_event_t;
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@ static ion_key_event_t ion_get_key_event() {
|
||||
// For now this is a bit silly but needed for instreface purpose.
|
||||
static const ion_event_t kEventForKeyDown[ION_NUMBER_OF_KEYS] = {
|
||||
UPPER_CASE_A, UPPER_CASE_B, UPPER_CASE_C, UPPER_CASE_D, UPPER_CASE_E,
|
||||
UPPER_CASE_F, UPPER_CASE_G, UPPER_CASE_H, UP_ARROW, DOWN_ARROW,
|
||||
UPPER_CASE_F, UPPER_CASE_G, DELETE, UP_ARROW, DOWN_ARROW,
|
||||
UPPER_CASE_K, UPPER_CASE_L, TRIG_MENU, LEFT_ARROW, RIGHT_ARROW,
|
||||
SEVEN, EIGHT, NINE, LEFT_PARENTHESIS, RIGHT_PARENTHESIS,
|
||||
FOUR, FIVE, SIX, PRODUCT, DIVISION,
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
static const char* kCharForKey[KEYBOARD_ROWS * KEYBOARD_COLUMNS] = {
|
||||
"A", "B", "C", "D", "E",
|
||||
"F", "G", "H", "UP", "DOWN",
|
||||
"F", "G", "DEL", "UP", "DOWN",
|
||||
"K", "L", "TRIG", "LEFT", "RIGHT",
|
||||
"7", "8", "9", "(", ")",
|
||||
"4", "5", "6", "*", "/",
|
||||
|
||||
Reference in New Issue
Block a user