Fixes #2618
This commit is contained in:
@@ -87,13 +87,22 @@ int checkIncDec(unsigned int event, int val, int i_min, int i_max, unsigned int
|
|||||||
uint8_t in = KEYS_PRESSED();
|
uint8_t in = KEYS_PRESSED();
|
||||||
if (!(i_flags & NO_DBLKEYS) && (EVT_KEY_MASK(event))) {
|
if (!(i_flags & NO_DBLKEYS) && (EVT_KEY_MASK(event))) {
|
||||||
bool dblkey = true;
|
bool dblkey = true;
|
||||||
if (DBLKEYS_PRESSED_RGT_LFT(in))
|
if (DBLKEYS_PRESSED_RGT_LFT(in)) {
|
||||||
newval = -val;
|
if (!isValueAvailable || isValueAvailable(-val)) {
|
||||||
|
newval = -val;
|
||||||
|
}
|
||||||
|
}
|
||||||
else if (DBLKEYS_PRESSED_RGT_UP(in)) {
|
else if (DBLKEYS_PRESSED_RGT_UP(in)) {
|
||||||
newval = (i_max > 100 ? 100 : i_max);
|
newval = (i_max > stops.max() ? stops.max() : i_max);
|
||||||
|
while (isValueAvailable && !isValueAvailable(newval) && newval>i_min) {
|
||||||
|
--newval;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (DBLKEYS_PRESSED_LFT_DWN(in)) {
|
else if (DBLKEYS_PRESSED_LFT_DWN(in)) {
|
||||||
newval = (i_min < -100 ? -100 : i_min);
|
newval = (i_min < stops.min() ? stops.min() : i_min);
|
||||||
|
while (isValueAvailable && !isValueAvailable(newval) && newval<i_max) {
|
||||||
|
++newval;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (DBLKEYS_PRESSED_UP_DWN(in)) {
|
else if (DBLKEYS_PRESSED_UP_DWN(in)) {
|
||||||
newval = 0;
|
newval = 0;
|
||||||
@@ -113,12 +122,37 @@ int checkIncDec(unsigned int event, int val, int i_min, int i_max, unsigned int
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (event==EVT_KEY_FIRST(KEY_RIGHT) || event==EVT_KEY_REPT(KEY_RIGHT) || (s_editMode>0 && (IS_ROTARY_RIGHT(event) || event==EVT_KEY_FIRST(KEY_UP) || event==EVT_KEY_REPT(KEY_UP)))) {
|
if (event==EVT_KEY_FIRST(KEY_RIGHT) || event==EVT_KEY_REPT(KEY_RIGHT) || (s_editMode>0 && (IS_ROTARY_RIGHT(event) || event==EVT_KEY_FIRST(KEY_UP) || event==EVT_KEY_REPT(KEY_UP)))) {
|
||||||
newval++;
|
do {
|
||||||
AUDIO_KEYPAD_UP();
|
newval++;
|
||||||
|
} while (isValueAvailable && !isValueAvailable(newval) && newval<=i_max);
|
||||||
|
|
||||||
|
if (newval > i_max) {
|
||||||
|
newval = val;
|
||||||
|
killEvents(event);
|
||||||
|
AUDIO_WARNING2();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
AUDIO_KEYPAD_UP();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (event==EVT_KEY_FIRST(KEY_LEFT) || event==EVT_KEY_REPT(KEY_LEFT) || (s_editMode>0 && (IS_ROTARY_LEFT(event) || event==EVT_KEY_FIRST(KEY_DOWN) || event==EVT_KEY_REPT(KEY_DOWN)))) {
|
else if (event==EVT_KEY_FIRST(KEY_LEFT) || event==EVT_KEY_REPT(KEY_LEFT) || (s_editMode>0 && (IS_ROTARY_LEFT(event) || event==EVT_KEY_FIRST(KEY_DOWN) || event==EVT_KEY_REPT(KEY_DOWN)))) {
|
||||||
newval--;
|
do {
|
||||||
AUDIO_KEYPAD_DOWN();
|
if (IS_KEY_REPT(event) && (i_flags & INCDEC_REP10)) {
|
||||||
|
newval -= min(10, val-i_min);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
newval--;
|
||||||
|
}
|
||||||
|
} while (isValueAvailable && !isValueAvailable(newval) && newval>=i_min);
|
||||||
|
|
||||||
|
if (newval < i_min) {
|
||||||
|
newval = val;
|
||||||
|
killEvents(event);
|
||||||
|
AUDIO_WARNING2();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
AUDIO_KEYPAD_DOWN();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!READ_ONLY() && i_min==0 && i_max==1 && (event==EVT_KEY_BREAK(KEY_ENTER) || IS_ROTARY_BREAK(event))) {
|
if (!READ_ONLY() && i_min==0 && i_max==1 && (event==EVT_KEY_BREAK(KEY_ENTER) || IS_ROTARY_BREAK(event))) {
|
||||||
|
|||||||
Reference in New Issue
Block a user