|
6 | 6 | #include "BaseRenderers.h" |
7 | 7 | #include "tcMenuKeyboard.h" |
8 | 8 | #include <IoLogging.h> |
| 9 | +#include "EditableLargeNumberMenuItem.h" |
9 | 10 |
|
10 | 11 | /** |
11 | 12 | * this makes the index based selections feel more natural |
@@ -38,6 +39,10 @@ void MenuEditingKeyListener::keyPressed(char key, bool held) { |
38 | 39 | else if (editor->getMenuType() == MENUTYPE_TEXT_VALUE) { |
39 | 40 | processMultiEditKeyPress(reinterpret_cast<TextMenuItem*>(editor), key); |
40 | 41 | } |
| 42 | + else if (editor->getMenuType() == MENUTYPE_LARGENUM_VALUE) { |
| 43 | + processLargeNumberPress(reinterpret_cast<EditableLargeNumberMenuItem*>(editor), key); |
| 44 | + |
| 45 | + } |
41 | 46 | else if (isMenuRuntimeMultiEdit(editor)) { |
42 | 47 | processIntegerMultiEdit(reinterpret_cast<EditableMultiPartMenuItem<byte[4]>*>(editor), key); |
43 | 48 | } |
@@ -156,6 +161,17 @@ void MenuEditingKeyListener::processAnalogKeyPress(AnalogMenuItem* item, char ke |
156 | 161 | item->setFromWholeAndFraction(currentValue); |
157 | 162 | } |
158 | 163 |
|
| 164 | +void MenuEditingKeyListener::processLargeNumberPress(EditableLargeNumberMenuItem* item, char key) { |
| 165 | + if(key >= '0' && key <= '9') { |
| 166 | + item->valueChanged(key - '0'); |
| 167 | + if (!item->nextPart()) { |
| 168 | + clearState(); |
| 169 | + item->setEditing(false); |
| 170 | + } |
| 171 | + } |
| 172 | + |
| 173 | +} |
| 174 | + |
159 | 175 | void MenuEditingKeyListener::processMultiEditKeyPress(TextMenuItem* item, char key) { |
160 | 176 | item->valueChanged(findPositionInEditorSet(key)); |
161 | 177 | if (!item->nextPart()) { |
|
0 commit comments