Giter Club home page Giter Club logo

Comments (6)

neu-rah avatar neu-rah commented on May 9, 2024

at the current state it will be useful only to do the menu part, all the desktop part would have to be coded apart, but the menu can cooperate as you can call/suspend several menus whenever needed.
doing the desktop part poses some problems for the current version
1 - the menu system is not doing associations with button and actions, actions are only associated with menu prompts
2 - menu prompts are limited to one line

from arduinomenu.

dontsovcmc avatar dontsovcmc commented on May 9, 2024

If I code my idea only using your classes, it it possible to use buttons associated with UP, DOWN codes when menu is not polling?

void loop() {
      if (!runMenu)  {
          if (allIn.read() == menu::enterCode) {
            runMenu = true;
            mainMenu.sel = 0; // reset the menu index fornext call
          } else if (allIn.read() == menu::upCode) {
            //do smth;
          } else if (allIn.read() == menu::downCode) {
            //do smth;
          }
    } else
      mainMenu.poll(menu_out,allIn); // temporary control and display on Serial Monitor
}

from arduinomenu.

neu-rah avatar neu-rah commented on May 9, 2024

yes, you can use input and output classes without/outside menu polling.
also the menu can do some association between buttons and actions, if your keyboard driver sends numeric characters for button press then the menu will call associated option.
options are numbered from 1 to 9 on serial menu and characters 1...9 have the effect of clicking the option.

beware that each .read() removes the character, it would be better to do a single read and then test the character.

from arduinomenu.

neu-rah avatar neu-rah commented on May 9, 2024
void loop() {
      if (runMenu)  
          mainMenu.poll(menu_out,allIn); // temporary control and display on Serial Monitor
      else if (allIn.available()) {
          char ch=allIn.read();
          if (ch == menu::enterCode) {
            runMenu = true;
            mainMenu.sel = 0; // reset the menu index fornext call
          } else if (ch == menu::upCode) {
            //do smth;
          } else if (ch == menu::downCode) {
            //do smth;
          }
    }
}

from arduinomenu.

dontsovcmc avatar dontsovcmc commented on May 9, 2024

Thanks!
I have 2 buttons in my device: upCode & enterCode

I prepair to add Exit option to exit from submenu and stop polling in main menu.
There is a same menu control in GoPro :)

from arduinomenu.

dontsovcmc avatar dontsovcmc commented on May 9, 2024

I done library:
https://github.com/dontsovcmc/ArduinoMultiDesktop

from arduinomenu.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.