|
@@ -119,6 +119,7 @@ MarlinUI ui;
|
119
|
119
|
#endif
|
120
|
120
|
#if ENABLED(TOUCH_BUTTONS)
|
121
|
121
|
#include "../feature/touch/xpt2046.h"
|
|
122
|
+ bool MarlinUI::on_edit_screen = false;
|
122
|
123
|
#endif
|
123
|
124
|
#endif
|
124
|
125
|
|
|
@@ -1445,18 +1446,23 @@ void MarlinUI::update() {
|
1445
|
1446
|
// - On menu screens move directly to the touched item
|
1446
|
1447
|
// - On menu screens, right side (last 3 cols) acts like a scroll - half up => prev page, half down = next page
|
1447
|
1448
|
// - On select screens (and others) touch the Right Half for +, Left Half for -
|
|
1449
|
+ // - On edit screens, touch Up Half for -, Bottom Half to +
|
1448
|
1450
|
//
|
1449
|
|
- void MarlinUI::screen_click(const uint8_t row, const uint8_t col, const uint8_t x, const uint8_t y) {
|
1450
|
|
- if (screen_items > 0) {
|
1451
|
|
- //last 3 cols act as a scroll :-)
|
|
1451
|
+ void MarlinUI::screen_click(const uint8_t row, const uint8_t col, const uint8_t, const uint8_t) {
|
|
1452
|
+ const int8_t xdir = col < (LCD_WIDTH ) / 2 ? -1 : 1,
|
|
1453
|
+ ydir = row < (LCD_HEIGHT) / 2 ? -1 : 1;
|
|
1454
|
+ if (on_edit_screen)
|
|
1455
|
+ encoderDiff = ENCODER_PULSES_PER_STEP * ydir;
|
|
1456
|
+ else if (screen_items > 0) {
|
|
1457
|
+ // Last 3 cols act as a scroll :-)
|
1452
|
1458
|
if (col > (LCD_WIDTH) - 3)
|
1453
|
|
- //2 * LCD_HEIGHT to scroll to bottom of next page. If we did 1 * LCD_HEIGHT, it just go 1 item down
|
1454
|
|
- encoderDiff = ENCODER_PULSES_PER_STEP * (encoderLine - encoderTopLine + 2 * (LCD_HEIGHT)) * (row < (LCD_HEIGHT) / 2 ? -1 : 1);
|
|
1459
|
+ // 2 * LCD_HEIGHT to scroll to bottom of next page. (LCD_HEIGHT would only go 1 item down.)
|
|
1460
|
+ encoderDiff = ENCODER_PULSES_PER_STEP * (encoderLine - encoderTopLine + 2 * (LCD_HEIGHT)) * ydir;
|
1455
|
1461
|
else
|
1456
|
1462
|
encoderDiff = ENCODER_PULSES_PER_STEP * (row - encoderPosition + encoderTopLine);
|
1457
|
1463
|
}
|
1458
|
1464
|
else if (!on_status_screen())
|
1459
|
|
- encoderDiff = ENCODER_PULSES_PER_STEP * (col < (LCD_WIDTH) / 2 ? -1 : 1);
|
|
1465
|
+ encoderDiff = ENCODER_PULSES_PER_STEP * xdir;
|
1460
|
1466
|
}
|
1461
|
1467
|
|
1462
|
1468
|
#endif
|