mirror of
https://github.com/MarlinFirmware/Marlin.git
synced 2024-11-27 22:08:02 +00:00
Apply encoder reverse options to keypad arrows
This commit is contained in:
parent
0d3fc7dd89
commit
e151f952a3
@ -2924,30 +2924,44 @@ void lcd_reset_alert_level() { lcd_status_message_level = 0; }
|
||||
|
||||
#if LCD_HAS_DIRECTIONAL_BUTTONS
|
||||
|
||||
// Manage directional buttons
|
||||
#if ENABLED(REVERSE_MENU_DIRECTION)
|
||||
#define _ENCODER_UD_STEPS (ENCODER_STEPS_PER_MENU_ITEM * encoderDirection)
|
||||
#else
|
||||
#define _ENCODER_UD_STEPS ENCODER_STEPS_PER_MENU_ITEM
|
||||
#endif
|
||||
#if ENABLED(REVERSE_ENCODER_DIRECTION)
|
||||
#define ENCODER_UD_STEPS _ENCODER_UD_STEPS
|
||||
#define ENCODER_LR_PULSES ENCODER_PULSES_PER_STEP
|
||||
#else
|
||||
#define ENCODER_UD_STEPS -(_ENCODER_UD_STEPS)
|
||||
#define ENCODER_LR_PULSES -(ENCODER_PULSES_PER_STEP)
|
||||
#endif
|
||||
|
||||
if (false) {
|
||||
// for the else-ifs below
|
||||
}
|
||||
#if BUTTON_EXISTS(UP)
|
||||
else if (BUTTON_PRESSED(UP)) {
|
||||
encoderDiff = -(ENCODER_STEPS_PER_MENU_ITEM);
|
||||
encoderDiff = -(ENCODER_UD_STEPS);
|
||||
next_button_update_ms = now + 300;
|
||||
}
|
||||
#endif
|
||||
#if BUTTON_EXISTS(DWN)
|
||||
else if (BUTTON_PRESSED(DWN)) {
|
||||
encoderDiff = ENCODER_STEPS_PER_MENU_ITEM;
|
||||
encoderDiff = ENCODER_UD_STEPS;
|
||||
next_button_update_ms = now + 300;
|
||||
}
|
||||
#endif
|
||||
#if BUTTON_EXISTS(LFT)
|
||||
else if (BUTTON_PRESSED(LFT)) {
|
||||
encoderDiff = -(ENCODER_PULSES_PER_STEP);
|
||||
encoderDiff = -(ENCODER_LR_PULSES);
|
||||
next_button_update_ms = now + 300;
|
||||
}
|
||||
#endif
|
||||
#if BUTTON_EXISTS(RT)
|
||||
else if (BUTTON_PRESSED(RT)) {
|
||||
encoderDiff = ENCODER_PULSES_PER_STEP;
|
||||
encoderDiff = ENCODER_LR_PULSES;
|
||||
next_button_update_ms = now + 300;
|
||||
}
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user