Skip to content

Commit d5fc2a2

Browse files
authored
Merge pull request prusa3d#3014 from Panayiotis-git/MK3_ButtonLongPress_Fix
Ignore button long-press event, if not allowed
2 parents 29159a5 + 87e4505 commit d5fc2a2

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

Firmware/ultralcd.cpp

+4-8
Original file line numberDiff line numberDiff line change
@@ -8051,7 +8051,7 @@ void menu_lcd_longpress_func(void)
80518051
// explicitely listed menus which are allowed to rise the move-z or live-adj-z functions
80528052
// The lists are not the same for both functions, so first decide which function is to be performed
80538053
if ( (moves_planned() || IS_SD_PRINTING || usb_timer.running() )){ // long press as live-adj-z
8054-
if(( current_position[Z_AXIS] < Z_HEIGHT_HIDE_LIVE_ADJUST_MENU ) // only allow live-adj-z up to 2mm of print height
8054+
if (( current_position[Z_AXIS] < Z_HEIGHT_HIDE_LIVE_ADJUST_MENU ) // only allow live-adj-z up to 2mm of print height
80558055
&& ( menu_menu == lcd_status_screen // and in listed menus...
80568056
|| menu_menu == lcd_main_menu
80578057
|| menu_menu == lcd_tune_menu
@@ -8061,12 +8061,10 @@ void menu_lcd_longpress_func(void)
80618061
lcd_clear();
80628062
menu_submenu(lcd_babystep_z);
80638063
} else {
8064-
// otherwise consume the long press as normal click
8065-
if( menu_menu != lcd_status_screen )
8066-
menu_back();
8064+
lcd_quick_feedback();
80678065
}
80688066
} else { // long press as move-z
8069-
if(menu_menu == lcd_status_screen
8067+
if (menu_menu == lcd_status_screen
80708068
|| menu_menu == lcd_main_menu
80718069
|| menu_menu == lcd_preheat_menu
80728070
|| menu_menu == lcd_sdcard_menu
@@ -8079,9 +8077,7 @@ void menu_lcd_longpress_func(void)
80798077
){
80808078
menu_submenu(lcd_move_z);
80818079
} else {
8082-
// otherwise consume the long press as normal click
8083-
if( menu_menu != lcd_status_screen )
8084-
menu_back();
8080+
lcd_quick_feedback();
80858081
}
80868082
}
80878083
}

0 commit comments

Comments
 (0)