tcMenu
tcMenuKeyboard.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2018 https://www.thecoderscorner.com (Nutricherry LTD).
3  * This product is licensed under an Apache license, see the LICENSE file in the top-level directory.
4  */
5 
6 #ifndef _TCMENU_KEYBOARD_H_
7 #define _TCMENU_KEYBOARD_H_
8 
9 #include <KeyboardManager.h>
10 
17 enum MenuEditingKeyMode: uint8_t {
18  KEYEDIT_NONE,
19  KEYEDIT_ANALOG_EDIT_WHOLE,
20  KEYEDIT_ANALOG_EDIT_FRACT,
21  KEYEDIT_MULTIEDIT_INT_START = 100,
22 };
23 
26 
39 class MenuEditingKeyListener : public KeyboardListener {
40 private:
41  WholeAndFraction currentValue;
42  MenuItem* currentEditor;
43  MenuEditingKeyMode mode;
44 public:
46  currentEditor = nullptr;
47  mode = KEYEDIT_NONE;
48  }
49  void keyPressed(char key, bool held) override;
50  void keyReleased(char key) override;
51 private:
52  void processSimpleValueKeyPress(ValueMenuItem* item, char key);
53  void processScrollValueKeyPress(ScrollChoiceMenuItem* item, char key);
54  void processAnalogKeyPress(AnalogMenuItem* item, char key);
55  void processMultiEditKeyPress(TextMenuItem* item, char key);
56  void processIntegerMultiEdit(EditableMultiPartMenuItem* item, char key);
57  void processLargeNumberPress(EditableLargeNumberMenuItem*, char key);
58  void clearState();
59 };
60 
61 #endif // _TCMENU_KEYBOARD_H_
Definition: MenuItems.h:329
Definition: MenuItems.h:433
Definition: MenuItems.h:485
Definition: ScrollChoiceMenuItem.h:33
MenuEditingKeyMode
Definition: tcMenuKeyboard.h:17
Definition: MenuItems.h:454
Definition: RuntimeMenuItem.h:201
Definition: tcMenuKeyboard.h:39
Definition: RuntimeMenuItem.h:235
Definition: EditableLargeNumberMenuItem.h:166