neu-rah / ArduinoMenu

Arduino generic menu/interactivity system
GNU Lesser General Public License v2.1
934 stars 189 forks source link

Buttons for changing numeric value in a field are reversed #264

Closed Sh4d closed 4 years ago

Sh4d commented 4 years ago

Using:

// Map physical buttons to joystick
keyMap joystickBtn_map[]={
 {-BTN_SEL, defaultNavCodes[enterCmd].ch} ,
 {-BTN_UP, defaultNavCodes[upCmd].ch} ,
 {-BTN_DOWN, defaultNavCodes[downCmd].ch}  ,
};
keyIn<3> joystickBtns(joystickBtn_map);

This is working as expected to navigate the menus, however when I select a field value the UP button decrements it and the DOWN button increments it:

MENU(mainMenu, "Main menu", doNothing, noEvent, wrapStyle
  , SUBMENU(subModes)
  , SUBMENU(subPalette)
  , FIELD(curSpeed , "Speed", "", 1, 1000, 100, 10, doNothing, noEvent, wrapStyle)
  , SUBMENU(subSettings)
  , SUBMENU(subAbout)
  , EXIT("Back")
  );

NAVROOT(nav, mainMenu, MAX_DEPTH, joystickBtns, out);
neu-rah commented 4 years ago

yes, it defaults to encoder, please add:

options->invertFieldKeys=true;

to your setup function

Sh4d commented 4 years ago

Argh, I saw that option but I coulda sworn it said it was deprecated so I didn't try it. Success, thanks again for the quick response!