Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

User defined increment/decrement step for processInt inputs #17

Open
fred-76 opened this issue Jun 2, 2021 · 0 comments
Open

User defined increment/decrement step for processInt inputs #17

fred-76 opened this issue Jun 2, 2021 · 0 comments
Assignees

Comments

@fred-76
Copy link

fred-76 commented Jun 2, 2021

IMPORTANT

Before submitting this issue
[x] Have you tried using the latest version of the library?
[x] Have you checked this has not already been submitted and/or resolved?
[x] If you are requesting help a better choice may be the Arduino forum

Subject of the issue

Add an increment/decrement user defined step in the inputs for Integers (instead of incDelta=1 as it is hard defined in void MD_Menu::handleInput.

You could use range[0 or 1].power for that purpose as it is not used in MD_Menu::processInt.

I did that and it works well:

bool MD_Menu::processInt(userNavAction_t nav, mnuInput_t *mInp, bool rtfb, uint16_t incDelta)
// Processing for Integer (all sizes) value input
// Return true when the edit cycle is completed
{
bool endFlag = false;
bool update = false;

int step_int = mInp->range[0].power;

if (step_int == 0) {
step_int=incDelta;
}

and then replace incDelta by step_int in the rest of processInt.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants