MenuBackend questions

Hey People,
I am trying to create an LCD Menu to be able
to adjust values via the encoder (not selecting options from a list) and furthermore i want to select a file out of a sdcards filesystem.

At the moment i can only move through my set up menu points and check if clicked the use button on them by comparing their names to a conditional case in the menuUseEvent function…

But i want to go for example to the point Delay ( in this case ) and not select of a list but just set a value with the encoder. in addition to that i plan to use a sdcard to load and save files from that means i somehow need a dynamical menu.

Is this actually possible with the lib MenuBackend? if not, is there a asynchronous not too heavy easy to use alternative?

This is more or less my code now :

#include <MenuBackend.h> // Menu Library

//this controls the menu backend and the event generation
MenuBackend menu = MenuBackend(menuUseEvent,menuChangeEvent);
	//beneath is list of menu items needed to build the menu
        MenuItem playmode = MenuItem("PlayMode");
          MenuItem setPlayMode = MenuItem("PlayMode", 'M');
            MenuItem mode1 = MenuItem("Mode 1 / straight");
            MenuItem mode2 = MenuItem("Mode 2 / backwards");
            MenuItem mode3 = MenuItem("Mode 3 / random");
            	MenuItem settings = MenuItem("Settings");
		MenuItem pin = MenuItem("Pin");
		MenuItem debug = MenuItem("Debug");
                MenuItem back1 = MenuItem("Back", 1);
	MenuItem options = MenuItem("Options");
		MenuItem setDelay = MenuItem("Delay",'D');
			MenuItem d100 = MenuItem("100 ms");
			MenuItem d200 = MenuItem("200 ms");
			MenuItem d300 = MenuItem("300 ms");
			MenuItem d400 = MenuItem("400 ms");
                        MenuItem back2 = MenuItem("Back", 2);
	
//this function builds the menu and connects the correct items together
void menuSetup()
{
	Serial.println("Setting up menu...");
	//add the file menu to the menu root
	menu.getRoot().add(playmode);
        playmode.addAfter(settings);
          playmode.addRight(setPlayMode);
            setPlayMode.addLeft(playmode);
            setPlayMode.addRight(mode1);
              mode1.addAfter(mode2);
              mode2.addAfter(mode3);
              
        settings.addBefore(playmode);
        settings.addAfter(options);
		//setup the settings menu item
		settings.addRight(pin);
			//we want looping both up and down
			pin.addBefore(debug);
			debug.addAfter(pin);
                        pin.addAfter(back1);
                        back1.addLeft(settings);
                      
	options.addBefore(settings);
		options.addRight(setDelay);
			setDelay.addLeft(options);
			setDelay.addRight(d100);
				//d100.addBefore(d100); //loop to d400 
                                d100.addLeft(setDelay);
				d100.addAfter(d200);
				d200.addAfter(d300);
				d300.addAfter(d400);
                                d400.addAfter(back2);
                                
                                back2.addLeft(setDelay);
	    
}
void menuUseEvent(MenuUseEvent used) {
  switch(used.item.getShortkey()) {
    case 1:
      Serial.println("back1");
      menu.moveLeft();
    break;
    case 2:
      Serial.println("back2");
      menu.moveLeft();
    break;
  }
}

/*
     This is an important function
     Here we get a notification whenever the user changes the menu
     That is, when the menu is navigated
*/
void menuChangeEvent(MenuChangeEvent changed) {
  if (changed.from.getName() == changed.to.getBefore()->getName()) {
    lcd.clear(); 
    lcd.setCursor(1,0);
    lcd.print(changed.to.getBefore()->getName());
    lcd.setCursor(0,1);
        lcd.print(">");lcd.print(changed.to.getName());
  } else {
    lcd.clear(); 
    lcd.setCursor(0,0);
    lcd.print(">");lcd.print(changed.to.getName());
    lcd.setCursor(1,1);
    lcd.print(changed.to.getAfter()->getName());
  }
}
void setup() {
  Serial.begin(115200); 
  menuSetup();
  Serial2.begin(31250);
  setupPins(); // set all Pin states etc.
  setupKeymaps();
  setupTimer3();
  delay(2000);
  initMode(1);
}
void loop() {
  if (Serial.available()) {
		byte read = Serial.read();
		switch (read) {
			case 'w': menu.moveUp(); break;
			case 's': menu.moveDown(); break;
			case 'd': menu.moveRight(); break;
			case 'a': menu.moveLeft(); break;
			case 'e': menu.use(); break;
		}
	}
  check_midi();
  play();
  check_buttons();
  set_LEDS();
}

best wishes,
JR

As written, you are restricted to just using a menuItem, not moving to it.

If you REALLY want to be able to move to it, you could modify the library and make setCurrent public instead of private, then pass in the menuItem you want to move to.

What do you mean with moving it?