Register / Login | Desktop view |
#include <tcMenuKeyboard.h>
const char KEYBOARD_STD_5X4_KEYS[] PROGMEM = "WXYZ123A456B789#L0R*";
KeyboardLayout keyLayout(5, 4, KEYBOARD_STD_5X4_KEYS);
MatrixKeyboardManager keyboard;
MenuEditingKeyListener menuKeyListener;
// its just one of the load commands, done for all values
stepmm = eeprom.read16(42);
menuSettingsSetupStepper1mm.setCurrentValue(stepmm);
menuFlexWeight.setCurrentValue(eeval);
void CALLBACK_FUNCTION onFlexPresetChange(int id) {
/*
int swap;
swap = menuFlexPreset.getCurrentValue();
sermsg( 2, 0, "TEST: flex mode change: ", swap);
*/
}
void setup() {
Wire.begin();
lcd.backlight();
setupMenu();
renderer.takeOverDisplay(myDisplayCallback);
lcd.clear();
/* lots of initialization and hardware calibration code */
lcd.clear();
renderer.giveBackDisplay();
renderer.setTitleRequired(false);
renderer.setEditorChars(0b01111111, 0b01111110, '=');
setupKeyboard();
setupSwitches();
menuMgr.load(eeprom);
}
When you change the name of a submenu, it changes all the variables of the items in it. Little bit annoying if you just change a name and need to adapt the code then.
void keyPressed(char key, bool held) override;
void keyReleased(char key) override;
class MyKeyListener : public MenuEditingKeyListener
void keyPressed(char key, bool held) override {
if(special_action_needed) {
// special actions here.
}
else MenuEditingKeyListener::keyPressed(key, held);
}
// same for released if you need it..
};
2. When you go down the root menu and you go past the last item, you start again on top at the 2nd item (my first item is e eenum field, didnt test if that matters)
4. Can the selector always be visible? When the menu is in stdby (without selector) and you click lets say down you "start" with the second item. When you press enter of course the first goes into edit mode.
5. and finally, i remember i did see it somewhere but cannot find it again. How can i change the menu timeout (before it reverts back to the root menu or finishes a edit)?
renderer.setResetIntervalTimeSeconds(seconds)